In a web MVC project, I have the following structure:
I thought - a lot, actually - about doing the following two steps:
I really find the two steps a very good idea, because, as I see it, both folders contain resources related to the structure from
So I'd like to ask: Are there any specific reasons, why my proposed moving of the two directories can not, or should not be done?
Thank you.
from Reasons for not having a compact structure of an MVC application?
mymvc/ -> Project root.
public/ -> Document root. The only one folder accessible from web.
assets -> Client-side assets. NOT ONLY for global themes and
libraries, BUT ALSO for each specific "view" controlled by the "src/Application"
components.
css/
js/
images/
...
index.php -> Application's entry point.
src/ -> UI layer rules.
Application/
Controller/
View/
ViewModel/
Dispatcher/ -> Application dispatching - route matching, dispatching to
the specified controller, etc.
... -> Other classes used by the components in the "src/Application"
folder.
templates/ -> Layout and template files.
Note: All domain model components (entities, repositories, data mappers, services, etc) reside in a folder outside of mymvc directory, so that they can be accessible by any other application, too.I thought - a lot, actually - about doing the following two steps:
- To move the
templatesdirectory tosrc/Applicationfolder. - To move the
assetsdirectory tosrc/Application, to create an alias/assets/in the web server (Apache) configuration - pointing to the moved folder, and to allow full access from the external world to it.
public directory - obviously not in a folder named or aliased assets.I really find the two steps a very good idea, because, as I see it, both folders contain resources related to the structure from
src/Application. So, instead of having something like this:src/Application/Controller/AboutUs.phppublic/assets/js/AboutUs.jstemplates/AboutUs/[multiple-layout-and-template-files],
src/Application/Controller/AboutUs.phpsrc/Application/assets/js/AboutUs.jssrc/Application/templates/AboutUs/[multiple-layout-and-template-files],
templates and assets) completely separated from the application folder.So I'd like to ask: Are there any specific reasons, why my proposed moving of the two directories can not, or should not be done?
Thank you.
from Reasons for not having a compact structure of an MVC application?
No comments:
Post a Comment