1
I have a layout for the home page of my project, with only a registration form and nothing else. After the person signs up, they are redirected to another page, completely different from the home page. 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';
}
Registration occurs normally, only the layout does not change, is on the same start screen. I have tried to put this code in the beforeFilter()
but it didn’t help either. How can I make it work?
You have the files
app/View/Users/index.ctp
andapp/View/Layouts/user.ctp
? What do you mean, "stays on the same home screen"? No user/index view appears?– bfavaretto
So, the Layouts/user.ctp I have, the Users/index.ctp does not ?
– Daniel Swater