I am creating a PHP web application framework (MVC). I would prefer not to use external libraries or components (since I want this to be purely my work at the moment)
Can you tell me some tips / tricks on which each of my files should be responsible for execution? For example, what should be processed by the Framework script and what should be processed by the script application used within the framework?
I’m constantly changing the place of writing other code (as I think to myself ... "Should it be processed by the framework or by each application?"), Which makes it more confusing when I go.
I read a bunch (20 ... 50 ... 100 even!) Of tutorials on MVC, frameworks, etc., but not so much that explains the perfect "flow" of the structure.
I am currently working as follows:
- Main index (index.php)
- Defines constants (DS = DIRECTORY_SEPARATOR, PS = PATH_SEPARATOR, etc.)
- Kits include paths (ROOT. '/ Classes', ROOT. '/ Includes', etc.)
- Loads the configuration file for the Framework (config.php)
- Sets the class autoloader class (__autoloader ())
- Installs some kind of Core object (Core :: init ($ config)?)
- Loads the application file index.php (app / index.php)
- Configuration (config.php)
- ($ config)
- ($ config ['debug'] = 0... - ..)
- (app/index.php)
- (APP_CONTROLLERS, APP_MODELS ..)
- (APP_PATH. '/classes', APP_PATH. '/includes' ..)
- (app/config.php)
- (app/config.php)
... , ? script, ? , .., URL- ..?? , Framework , ..?
, , / .. ( , ), , , .
- !
, , - , , - ! .
=)