The devtools are great and save me a lot of time when bootstraping/scaffolding my applications and there is also basic module support builtin: You can create a single module application with the hardcoded path and name 'frontend'.
I would like to extend the module functionality since I think it is a very basic and important aspect of Phalcon to easily develop modular applications. I would like to support different parameters and new commands for handling modules, but I want to hear your thoughts on this:
- How do you think multi module applications should be handled by the devtools?
- How would you like to have it called from the CLI?
- Should modules be configurable (directory structure, defining models, services, routes ...) and how should that configuration be done?
As a first step I can think about something like the following:
Create a module application (this almost works out of the box):
phalcon project modules --module-name=myFancyModule
This call would create a project with the MyFancyModule module. --module-name would default to 'frontend' so the existing functionality won't break.
To add a module to an existing multi module application we might use something like (inside the project path):
phalcon add-module myEvenFancierModule
It would also be great if we could somehow define the directory structure of the generated projects since I like the public/private approach:
phalcon project modules --module-name=holyMoly --module-root=private/modules
BTW: Could we make use of the .phalcon directory to store configurations like this?
Please share your thoughts: What do you think?
P.S. I am just experimenting with Yeoman Generators https://github.com/yeoman/yeoman/wiki/Generators which might work hand in hand with the devtools and would make a complex configuration (e.g. services or routes) very comfortable to handle. A Phalcon generator might be a handy extension.