I have a layout for the home page of my project, with only one registration form and nothing else. After the person registers, it is redirected to another page, completely different from the homepage. My controller looks like this:
if ($this->User->save($this->request->data){
$this->redirect(array('controller' => 'users', 'action' => 'index'));
}
I created another controller called UsersController
and a method called index()
, and inside it I put it like this:
function index(){
$this->layout = 'user';
}
The registration usually occurs, but the layout does not change, it is in the same home screen. I already tried to put this code in beforeFilter()
but it did not work. How can I make it work?