views:

80

answers:

1

Hi there!

Can anyone tell me how can I define and use a specific layout for a model (not a template)? I would like to do this for my custom 404 error page.

Thanks in advance, Best regards!

+1  A: 

As Peter Bailey commented above, your layout is a component of the view and has nothing to do with models. Therefore you'd be able to do something like this in the actions module you're using (normally default):

public function executeError404(sfWebRequest $request)
{
  $this->setLayout("your_layout_name");

  // ...
}

and then in your [APPNAME]/templates directory, create the your_layout_name.php template file as you would with any other template.

richsage