We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Multiple Modules - Shared Model?

I have seen how you can share common layouts in two different modules views.

How can I share the same model directory. Or is the point that seperating modules forces you into seperating your models?

Is it valid to want to have two seperate modules when you only to seperate controllers and views.

edited Sep '15


In Backend\Module.php set the models namespace to the common directory:

                'Multiple\Backend\Controllers' => '../apps/backend/controllers/',
                'Multiple\Backend\Models'      => '../apps/common/models/',


There are many examples in the MVC sample that can help you: https://github.com/phalcon/mvc#phalcon-mvc-examples