Para adicionar links a páginas personalizadas na barra lateral do painel de administração do Bootstrap, o senhor precisa criar sua página, mapeá-la com o roteador principal e adicioná-la à barra lateral.
admin/
my-custom-page.php
admin/index.php
para levar à sua nova página.$router->map('GET', '/my-custom-page', 'my-custom-page.php', 'my-custom-page');
admin\inc\sidebar.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');
O painel de administração do Bootstrap
Arquivos e lógica
Barra de navegação
Conteúdo
Depurar