0

I am not sure how to handle this scenario, but I am sure it is simple. Pages within my site are handled via a layout, but I have an index that is independent of the rest... how do I present that page without directing it through the layout?

tia

1
  • Like all pages have Layout foo but only IndexController::indexAction has layout bar? Inside controller: $this->layout('bar') Commented Jan 12, 2014 at 10:50

1 Answer 1

1

Within a controller action, create a new view model instance and pass the view parameters.

$view = new ViewModel($params);

Disable the view from rendering the layout.

$view->setTerminal(true);

Set the view script path to the file you need to render without the layout

$view->setTemplate('/module-name/controller-name/view-file-name');

Return the view model

return $view;
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I knew it was going to be something simple.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.