This post is about re-utilizing views, and its best approach to do that.
We have a little framework on top on phalcon , we reutilize it in all our projects (general controller/model function, rapid crud generation, etc), so the the prototyping of an application starts generally with model creation a fast configuration. At this point we have catalogs working and the problem with views starts here.
The excpeted behavior its the framework to have its own views in a views folder inside it, so we can put in a git submodule and easy share it; but when we start the customize phase of each application we put views inside the apps folder (modules) and when volt instantiates (DI) we need to specify wich views-folder to use: the default or the custom one.
The desirable application folder structure
project/
apps/
MainModule/
Models/
Controllers/
Views/ <-- The app Views ( first in hierarchy )
Common/ <-- (our framework)
Controllers/ (rest-json, soap etc)
Models/
Views/ <-- all base views (second in hierarchy )
The actual folder structure:
project/
apps/
MainModule/
Models/
Controllers/
Common/ <-- (our framework)
Controllers/ (rest-json, soap etc)
Models/
Views/
Common/
MainModule/
The problem here is when i create/modify a view that i want to share across projects i have to manually update or make a git-submodule commonViews to share the views. Not too elegant.
Is there any easy-ellegant way to do this or an alternative to this folder structure to get things happen.