After registration, redirect to another layout in Cakephp

1

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?

    
asked by anonymous 04.03.2014 / 14:08

1 answer

1

I solved the problem, I created the Users folder within the view with the index.ctp file Thanks for the tip

    
04.03.2014 / 14:34