We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to create a model in Multi-Modules project

I use this command to create a project

phalcon project --name=phalcon_multimodule_example --type=modules

then I use this command to create a model

phalcon model Admins

but nothing happend, I need help



85.5k
Accepted
answer

i think models should per project not per module, that doesn't make any sense

I usually use 4 modules per project, but I create all manually

  • Frontend
  • Backend
  • Core << Here I have all the logic and common components
  • Api

Good luck



1.5k

i think models should per project not per module, that doesn't make any sense

I just wanna point out that this model belong to this module



1.5k
edited Mar '18

I usually use 4 modules per project, but I create all manually

  • Frontend
  • Backend
  • Core << Here I have all the logic and common components
  • Api

Good luck

I will try it again。 Thanks

Phalcon is not trully modular so you cannot do that without writing your own Application class.

I have my own implementation that makes Phalcon trully modular, there isn't a single code outside of module (well except for bootstrap and index.php). It is much more advanced now but you would be able to write your own if you read here: https://forum.phalcon.io/discussion/17365/phalcon-is-not-trully-modular-framework-and-how-to-solve-it