How we can set layout in the controller file using cakephp?
Answer Posted / Nishant Pal
To set a layout for a specific action, you can specify it in the action's declaration:n```phpnpublic function actionName() {n $this->layout = 'your_layout';n}n``` If you want to set the default layout for all actions, set it in your controller's beforeFilter():n```phpnpublic function beforeFilter() {n $this->layout = 'your_layout';n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category