The 'Administrative Panel' module in the HLEB2 framework is an extension to the HLOGIN registration library, but it can also be used independently as one or more administrative panels on a single site or as a public frontend for a website.
This library was used to create the look of this framework documentation site without significant modifications.
Using Composer:
$composer require phphleb/adminpan
By running the following command, the adminpan.php file, describing how to build a menu structure for the administrative panel, will be copied to the /config/structure/ directory.
$php console phphleb/adminpan add
Initially, the /config/structure/adminpan.php file contains an empty array, with no menu sections defined. Menu sections are assigned by specifying special route names (or standard links). Example for a demo route:
Here, it specifies that for the menu 'adminpan' (named the same as the adminpan.php file), the URL '/{lang}/panel/page/default' is assigned the page() controller of the ExamplePanelController class, targeting the 'index' method. Additionally, the route has a name 'adminpan.default', which is needed for mapping to a section in the menu. Now the first menu item can be created in the /config/structure/adminpan.php file.
The menu can contain nested dropdown lists ('section'), currently there's only one assigned with a single item.
If you navigate to the URL '/ru/panel/page/default', the design will be set to 'base' (from the settings) for the page. Also, the menu will have the 'Main Menu' with the active item 'Test Page' where content from the ExamplePanelController will be displayed.
When used in conjunction with the HLOGIN library, the admin panel routes may be accessible only to a specific type of user (authenticated).
For a deeper understanding of the admin panel operation, you can deploy this site locally and explore its menu structure.
Library repository: github.com/phphleb/adminpan