I am developing a website with Silex, and due to this new approach to me (everything on a single file), I have some doubts.
How do you structure your controllers and so?
What I have done is to have index.php with 3 single require files:
- config.php:
includes autoload and any required file, holds all the configurations and prepares any information that should be accessible at any time. - front_controllers.php: does all the front stuff.
- back_controllers.php: includes any controller related to my backend.
Do you find this is a good choice? Otherwise, is there anything I am missing (maybe a working pattern to organize all of this)?
In additional to my comment i suggest the next file sturcture
If the forum controller becomes too big you can divide its functionality into several files and place them in the appropriate folder. For example: