Customization¶
Overriding templates¶
You can copy one or all of the plugin templates into your application, into the
folder templates/plugin/CakeLte/, keeping the same structure as templates/.
The available files are:
- Layouts
templates/layout/default.phptemplates/layout/login.php- Content
templates/element/content/header.php- Header navbar
templates/element/header/main.phptemplates/element/header/menu.phptemplates/element/header/search.phptemplates/element/header/messages.phptemplates/element/header/notifications.phptemplates/element/header/language.phptemplates/element/header/fullscreen.phptemplates/element/header/color-mode.phptemplates/element/header/user.php- Footer
templates/element/footer/main.php- Left sidebar
templates/element/sidebar/main.phptemplates/element/sidebar/menu.php
After copying, the plugin renders your application template instead of its own.
The copy_files command¶
To copy all files at once:
To copy a single category:
Use --force to overwrite files that already exist:
See Commands for the full reference.
Bake templates¶
CakeLTE ships bake templates for the CRUD views and the authentication pages.
The bake plugin must be installed in your application
(composer require --dev cakephp/bake).
Generate the CRUD views with the CakeLTE theme:
Generate one authentication template:
bin/cake bake template Users login -t CakeLte
bin/cake bake template Users register -t CakeLte
bin/cake bake template Users recovery -t CakeLte
The shipped templates are index, view, add, edit, login, register
and recovery.