0
I created a layout for sending newsletter, called email.ctp and put inside the directory View/Layout. My question is how I use this layout instead of the layout default.ctp
0
I created a layout for sending newsletter, called email.ctp and put inside the directory View/Layout. My question is how I use this layout instead of the layout default.ctp
2
You will need to use $this->layout = ...;
in his AppController
You can use:
public function beforeRender() {
parent::beforeRender();
$this->layout = 'layout_customizado';
}
Another example would be, applying a layout for each "View" within the AppController
class UsersController extends AppController {
public function view_active() {
$this->set('titulo_para_o_layout', 'Ver atividade dos usuários');
$this->layout = 'layout1';
}
public function view_image() {
$this->layout = 'layout_image';
//Mostra foto do usuário
}
}
Browser other questions tagged php cakephp layout view
You are not signed in. Login or sign up in order to post.
In my case, I used the second example
– Meeeefiu
@Mathdesigner47 if it worked, please mark the answer as correct
– Guilherme Nascimento