All configuration options are stored under the Admin key in your application's configuration.
Set the default language for the admin panel:
'Admin' => [
'defaultLocale' => 'bg' // or any other locale
]Customize the brand name and logo displayed in the admin panel:
'Admin' => [
'Brand' => [
'name' => 'My Admin',
'html' => '<span class="fs-4 fw-bold">My<span class="text-primary">Admin</span></span>'
]
]Configure the home link used in the brand and breadcrumbs:
'Admin' => [
'Home' => [
'title' => __('Home'),
'url' => '/admin',
'icon' => 'house-door'
]
]Configure the page title displayed in the browser tab and header:
'Admin' => [
'Title' => 'My Admin Panel'
]The title value can be a string or a closure function that returns a string dynamically.
The sidebar menu can be customized with icons, links, and optional submenus.
'Admin' => [
'Sidebar' => [
'iconDefaults' => [
'tag' => 'i',
'namespace' => 'bi', // Bootstrap Icons
'prefix' => 'bi',
'size' => null,
],
'menu' => [
'Dashboard' => [
'title' => __('Dashboard'),
'icon' => 'speedometer2',
'url' => [
'plugin' => 'Admin',
'controller' => 'Dashboard',
'action' => 'index'
],
],
'Users' => [
'title' => __('Users'),
'icon' => 'people',
'url' => [
'plugin' => 'Admin',
'controller' => 'Users',
'action' => 'index'
],
],
'Settings' => [
'title' => __('Settings'),
'icon' => 'gear',
'submenu' => [
'General' => [
'title' => __('General'),
'url' => [
'plugin' => 'Admin',
'controller' => 'Settings',
'action' => 'general'
],
],
'Security' => [
'title' => __('Security'),
'url' => [
'plugin' => 'Admin',
'controller' => 'Settings',
'action' => 'security'
],
],
],
],
],
],
]Each menu item can have the following properties:
| Property | Type | Required | Description |
|---|---|---|---|
title |
string | Yes | Display text - use __('Title') or __d('admin', 'Title') |
icon |
string/array | No | Bootstrap Icons name or icon config array |
url |
array | No | CakePHP URL array, defaults to ['plugin' => 'Admin', 'controller' => name, 'action' => 'index'] |
submenu |
array | No | Array of submenu items with the same structure |
Icons use Bootstrap Icons by default. You can customize the icon defaults:
| Option | Default | Description |
|---|---|---|
tag |
i |
HTML tag for icons |
namespace |
bi |
CSS namespace |
prefix |
bi |
CSS class prefix |
size |
null |
Icon size class (sm, lg, etc.) |
To use FontAwesome icons globally, change iconDefaults:
'iconDefaults' => [
'prefix' => 'fa',
'namespace' => 'fa-solid'
]Or set per-icon:
'Dashboard' => [
'title' => __('Dashboard'),
'icon' => [
'name' => 'gauge',
'prefix' => 'fa',
'namespace' => 'fa-solid'
]
],Configure CSS, JavaScript, and font assets for the admin panel.
'Admin' => [
'Layout' => [
'cssDefaults' => [...], // Default CSS assets (Bootstrap)
'css' => [], // Additional CSS to append
'scriptDefaults' => [...], // Default JS assets (Bootstrap)
'script' => [], // Additional JS to append
'fonts' => [...], // Google Fonts configuration
],
]Bootstrap CSS and Bootstrap Icons are loaded by default. These assets are always rendered first.
Add additional CSS assets that will be appended after the defaults.
Each entry can be:
-
String URL - Simple URL to a CSS file:
'css' => [ 'https://example.com/custom.css', ],
-
HTML Tag - Raw link tag (will be output as-is):
'css' => [ '<link rel="stylesheet" href="https://example.com/extra.css">', ],
-
Array with options - URL with integrity and crossorigin attributes:
'css' => [ [ 'url' => 'https://example.com/secure.css', 'integrity' => 'sha384-...', 'crossorigin' => 'anonymous', ], ],
Bootstrap Bundle JS is loaded by default. These assets are always rendered first.
Add additional JavaScript assets that will be appended after the defaults.
Each entry can be:
-
String URL - Simple URL to a JS file:
'script' => [ 'https://example.com/custom.js', ],
-
HTML Tag - Raw script tag (will be output as-is):
'script' => [ '<script src="https://example.com/extra.js"></script>', ],
-
Array with options - URL with integrity and crossorigin attributes:
'script' => [ [ 'url' => 'https://example.com/secure.js', 'integrity' => 'sha384-...', 'crossorigin' => 'anonymous', ], ],
Configure Google Fonts or other web fonts:
'fonts' => [
'enabled' => true,
'preconnect' => [
'https://fonts.googleapis.com',
'https://fonts.gstatic.com',
],
'files' => [
'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap',
],
],| Key | Type | Description |
|---|---|---|
enabled |
bool | Enable/disable font loading |
preconnect |
array | URLs to preconnect for faster loading |
files |
array | Font stylesheet URLs to load |
In your project's configuration file (e.g., config/app_local.php):
use Cake\Core\Configure;
Configure::write('Admin.Layout.css', [
'/css/admin-custom.css',
'https://cdn.example.com/theme.css',
]);Configure::write('Admin.Layout.script', [
'/js/admin-custom.js',
[
'url' => 'https://cdn.example.com/analytics.js',
'crossorigin' => 'anonymous',
],
]);Configure::write('Admin.Layout.fonts.enabled', false);Configure::write('Admin.Layout.fonts', [
'enabled' => true,
'preconnect' => [
'https://fonts.googleapis.com',
'https://fonts.gstatic.com',
],
'files' => [
'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap',
],
]);Assets are loaded in the following order:
-
CSS:
cssDefaults(Bootstrap CSS, Bootstrap Icons)css(your custom CSS)fonts(Google Fonts if enabled)- Plugin styles (
Brammo/Admin.styles) - View-specific CSS blocks
-
JavaScript:
scriptDefaults(Bootstrap Bundle)script(your custom scripts)- Plugin scripts (
Brammo/Admin.main) - View-specific script blocks