I have compiled Micro Framework from the following components:
- For Routing: FastRoute
- For working with HTTP: symfony/http-foundation
- For Dependency Injection: PHP-DI
- For Template Engine: Twig
- For work with Databases: PDO
- Run
composer update
- Create in folder config file config.php using config.example.php
- Create, in core, folder cache (
chmod 744 cache
)
- cache
- config
- config.php - Basic settings to hide
- di.config.php - Dependency Injection settings
- public
- index.php
- src
- Controller
- MainController.php -Parrent class for Controller's
- Core
- Core.php - Parrent class for Controller's and Model's
- Model
- MainModel.php - Parrent class for Model's
- Controller
- Utilities
- Database.php - Database connection class
- View HTML-шаблоны
- $this->model({CLASSNAME}) — referring to models (Controller's and Model's)
- $this->db() — work with Databases (Controller's and Model's)
- $this->session() — work with Session-s (Controller's and Model's)
- $this->http() — work with HTTP Request and HTTP Response (Controller's)
- $this->tmp() — work with Template Engine (Controller's)
I hope this Framework will be useful for you in your work or for an interview