The HLEB2 framework implements a specific project directory structure, thus maintaining an agreement with the developer on which directories to store settings and classes necessary for the framework. It also allows developers to quickly understand the folder structure in a new project based on the HLEB2 framework.
The following diagram shows the folders of a new project after installing the framework:
The files listed in the diagram are installed with the framework and are part of its structure, but are intended for modifications and filling by the developer. In addition to this, the developer can further develop the project according to this structure by adding new classes, folders, libraries, and more.
Unlike the previous version of the framework, there is now a new folder Bootstrap, which contains development classes that are tied to the core
framework processes.
With these classes, the framework's operation is freed from unnecessary abstractions; previously, these classes
were created from configuration, but now the developer can modify them directly at their discretion.
The app folder is intended for the application code that is based on the framework.
This directory contains classes for creating containers and services, as well as others that serve as both editable classes and parts of the framework itself.
Contains classes responsible for handling specific events that occur during the processing of requests by the framework.
Includes the class ErrorContent.php for assigning custom content returned during HTTP errors.
Here are commands to execute from the console or directly from the code. You can create custom commands based on the DefaultTask.php command template. The built-in framework commands are contained within the framework's code.
Folder for framework controllers. The template for creating a controller is the file DefaultController.php.
The controller is a part of the MVC architecture (Action-Domain-Responder
for web), responsible for further managing the request processing that has already been identified by the
router, but should not contain business logic.
This directory is intended for middleware controllers, executed before or after a controller, which can be used only once in a route.
The folder is intended for Model classes.
The model is another part of the MVC architecture (Action-Domain-Responder
for web), responsible for data.
Configuration consists of PHP files containing the framework's settings.
Public directory. Contains the file index.php as the entry point for the web server.
Intended for various auxiliary files.
This can include templates for pages or emails, as well as sources for compiling styles and scripts, etc.
The view is a part of the MVC architecture (Action-Domain-Responder for web). This folder is intended for web page templates. Twig templates can also be stored here.
Routing is an important part of any web framework. This folder contains the file map.php, which holds the routing map of the framework.
Auxiliary files generated during the framework's operation.
Access permissions to this folder should allow full access for both the web server and a developer for terminal
work.
Logs and error reports in a standardized format.
This file without an extension contains PHP code and executes console commands. For example:
$php console --version
Displays information about the current version of the framework.
← Framework Configuration Running on PHP Server →