Virtual root
By default, all requests from users for an executable file (*.php) or folder
are processed by the framework (
-
directly requested php-file
or
file
index.php in requested folder - file
.router.php up the directory hierarchy relative the query
As soon as the first file is found, it executes it, interrupting further search.
All active virtual roots must be registered in the config (key 'roots').
Example
Suppose we have two virtual roots
|
Searching for a corresponding entity |
---|---|
/feedback.php |
|
/admin/ |
|
Following this logic, you can redefine any file in the framework’s virtual root by creating file in its virtual root along a similar relative path.
If no file is found, the
if nothing has been found - it throws an exception
Access to sections (folders)
Framework allows to override template and wrapper for each section,
as well as to restrict\allow access to the section and all subsections for specific user groups.
To do this, you need to create a file
TEMPLATE — code of the templateWRAPPER — code of the wrapper-
ACCESS — dictionary, describing access: key - code of user group, value - true\false access flag
Example
<?php return [ 'TEMPLATE' => 'admin', 'ACCESS' => [ '*' => false, 'root' => true, ], ];
* — pseudo code for any user (includes unauthorized)@ — pseudo code for authorized userroot — code of user group 'Root'
For more complex access restriction logic, use exceptions in your own code.
Template and wrapper
When the request is completed, the engine wraps the result in a wrapper of template, if necessary.
Ask question