maiconpinto / cakephp-adminlte-theme

CakePHP AdminLTE Theme
http://maiconpinto.github.io/cakephp-adminlte-theme/
MIT License
174 stars 111 forks source link

Change the layout #33

Closed mikemack closed 7 years ago

mikemack commented 7 years ago

How to change the layout from default to collapse?

I try from AppController: $this->viewBuilder()->theme('AdminLTE.collapsed');

and throw an error An Internal Server Error Occurred

maiconpinto commented 7 years ago

Hello @mikemack you can change layout using https://book.cakephp.org/3.0/en/views.html#layouts

For example:

// src/Controller/AppController.php

public function beforeRender(Event $event)
{
    $this->viewBuilder()->layout('AdminLTE.collapsed');
}

OR set into .ctp files:

$this->layout = 'AdminLTE.collapsed';