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:


Check out my Webird framework. I'm doing basically all of the things in the example plus some other ideas. There are shared models, shared layout and partial views between modules and each module can have its own private layouts and partials. I accomplished having both a shared view and private module view capability by adding a few Volt extensions. Additionally the build process compiles the views for the production release.