How we can set layout in the controller file using cakephp?
Answer / 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 |
What is habtm?
What are sessions in php.
What is a helper and list some common helpers name used in cakephp?
What is a element?
What is the naming convention in cakephp?
How to write, read and delete the session in cakephp?
Explain the difference between beforerender() and beforefilter() in cakephp?
What do you mean by component in cakephp? List some commonly used components.
What is the use of requestaction method?
How to get current url in cakephp?
How to install cakephp with composer?
What is the use of security.salt and security.cipherseed in cakephp? How to change its default value?