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

A lot of modules. And the interaction between them.

Good morning.

I took MVC/Application as a basis.

The structure is modular. And I'm very interested in how modules can interact with each other.

If in the file phalcon/mvc/application.zep

Only one module is initialized

moduleObject->registerAutoloaders(dependencyInjector);
moduleObject->registerServices(dependencyInjector);

There are no cycles or anything else.

Maybe I do not know something and still there is a way. Or write the very implementation of all this.



7.6k
edited Mar '17

I don't understood something...

I took MVC/Application as a basis.

The structure is modular. And I'm very interested in how modules can interact with each other.

if you took MVC there's no modular structure...

if you don't use Namespaces in MVC everything what is including for available classes is in app/config/loader.php in lines:

$loader->registerDirs(
    [
        $config->application->controllersDir,
        $config->application->modelsDir
    ]
)->register();

if you want to choose HMVC (hierarhical MVC - modular structure) create project with phalcon project projectname --type=modules