Per aggiungere collegamenti a pagine personalizzate nella barra laterale del pannello amministrativo Bootstrap, deve creare la sua pagina, mapparla con il router principale e poi aggiungerla nella barra laterale.
admin/
my-custom-page.php
admin/index.php
per condurre alla sua nuova pagina.$router->map('GET', '/my-custom-page', 'my-custom-page.php', 'my-custom-page')
;adminincsidebar.php
$active = false;
// test if the page is active using $match from the router.
// 'my-custom-page' is the name we gave in index.php => $router->map()
if (isset($match['name']) && $match['name'] == 'my-custom-page') {
$active = true;
$is_category_collapsed = false;
}
// add category
$sidebar->addCategory('new-category', 'New Category', '', '', true, $is_category_collapsed);
// add nav into category - the 'newCategory' object is the sidebar's newly created category.
// its name ('newCategory') is the lower-camelcase version of 'new-category'
$sidebar->newCategory->addNav('my-custom-page', 'nav flex-column');
// add page into nav - the 'myCustomPage' object is the sidebar's category newly created nav.
// its name ('myCustomPage') is the lower-camelcase version of 'my-custom-page'
$sidebar->newCategory->myCustomPage->addLink(ADMIN_URL . 'my-custom-page', 'MyCustom Page', 'fas fa-users', $active, 'class=nav-item', 'class=nav-link d-flex align-items-center');
Il pannello amministrativo di Bootstrap
File e logica
Barra di navigazione
Contenuto
Debug