Answer the question
In order to leave comments, you need to log in
Are there any standards for a php backend service directory structure?
I love standards. After a dozen years in web programming as a self-taught person, I decided that this was no longer possible and began to massively implement standards: BEM, OOP, PSR, Composer, HMVC, Semver ... I managed to find standards for this, some I already actively use, but I just can’t to find at least a draft of the standard for building directories (folders) of the project. Is there any standard or at least recommendations for this?
For example, the currently planned project structure is:
controllers/
models/
views/
-->themename/
modules/
-->module_name/
----->controllers/
----->models/
----->views/
-->module_name/
----->controllers/
----->models/
----->views/
vendors/
-->3rd party_name/
----->class_name/
----->class_name/
-->3rd party_name/
----->class_name/
-->3rd party_developer_name/
----->class_name/
site_root /
-->index.php
If you know of any standard on this, please recommend where to read it, or at least give me advice on how to improve my structure.
Answer the question
In order to leave comments, you need to log in
Look at the directory structure in existing frameworks (if you haven't already). You will surely find something useful for yourself.
There is no single standard, it is different in different frameworks.
If you look at your code, then modules is not needed: its content should already be distributed across the model, controllers, and templates.
And if you need pluggable external modules, then composer and the vendor directory are for this.
Look at the directory hierarchy in the symfony 4 framework, it seems to me the most reasonable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question