views:

349

answers:

1

I have a static page that I want to serve so I made a .ctp in the /views/pages/ directory. The problem is that it's using the default layout which I do not want to use. I tried making my own pages_controller and passing the $layout var but that does not work. There has to be a way to tell a /pages/ to use another layout.ctp. No?

A: 

few things to check

  • make a custom pages_controller.php
  • define variable $layout and set it to the layout you want.
  • make sure the layout exists in views/layout/
Funky Dude
I set $this->layout = 'xxx'; in the display function on app/controllers/pages_controller, right?
Selino
Yes, that's how you do it. Is that pages controller the one being loaded? Check by making a function in it to output something simple, and try to load that url (eg make PagesController::test(), and try to access /pages/test)
Travis Leleu
Yes, I've been trying that and no avail. It's not passing anything. Everything I had read said that I just place an /app/controllers/pages_controller.php and it would be set. Is there another switch to flip?
Selino
check route.php in config folder. see if it's rerouted to somewhere else.
Funky Dude
It's def an issue with my beforeFilter() in my app_controller. I think it's not allowing me to pass any set(var) without authenticating first.
Selino