My default layout is default.ctp, but I want to use another layout default-scaffolds.ctp only for scaffolding views, when I use in the controller:
public $scaffold;
I tried in the AppController
public function beforeScaffold() {
$this->layout = 'default-scaffolds';
}
but that didn't work.
I appreciate any help with this.
Add this beforeRender()
public function beforeRender() {
if (in_array($this->request->action, array('index', 'add', 'view', 'edit'))) {
$this->layout = 'default-scaffolds';
}
}