Layouts¶
CakeLTE ships two layouts:
CakeLte.default- the main admin layout.CakeLte.login- an authentication layout (login, register, recovery).
Using a layout¶
Set the layout in your controller:
Or set the $layout property in AppView (shown below).
Using the CakeLteTrait¶
The recommended way to wire the plugin is the CakeLteTrait in
src/View/AppView.php:
namespace App\View;
use Cake\View\View;
use CakeLte\View\CakeLteTrait;
class AppView extends View
{
use CakeLteTrait;
protected string $layout = 'CakeLte.default';
public function initialize(): void
{
parent::initialize();
$this->initializeCakeLte();
}
}
Calling initializeCakeLte() registers:
- the
CakeLte.CakeLtehelper, - the BootstrapUI helpers (
Html,Form,Flash,Paginator,Breadcrumbs,ColorMode), - the menu helpers (
MenuandMenuLte).
Content blocks¶
The CakeLte.default layout renders the page title and a headerEnd block:
$this->assign('title', __('Dashboard'));
$this->start('headerEnd');
echo $this->Html->link(__('New'), ['action' => 'add'], ['class' => 'btn btn-primary']);
$this->end();
headerEnd replaces the default breadcrumb in the content header.
Layout options¶
CakeLte.defaultCakeLte.login