Individually I am able to change cakephp default layout by using controller.For example I have used
public function login() {
$this->layout="make"; //here I have changed layout for single action
if ($this->request->is('post')) {
//some code...
}
}
Here I have changed layout!! But the problem is this layout is not default.I want to apply this layout for all controller.How can I do this?
CakePHP's default layout is located at /app/View/Layouts/default. ctp . If you want to change the overall look of your application, then this is the right place to start, because controller-rendered view code is placed inside of the default layout when the page is rendered.
Layouts. A layout contains presentation code that wraps around a view. Anything you want to see in all of your views should be placed in a layout. CakePHP's default layout is located at templates/layout/default. php.
In your AppController
public function beforeRender() {
parent::beforeRender();
$this->layout = 'custom';
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With