Disabling Layouts and Views in CakePHP

By: SethCardoza - Published: 2009-07-28 23:33:44 in Category: CakePHP

It is easy to disable both the layout and view in CakePHP by putting the following line in your controller action:

$this->autoRender = false;

If you want to disable just the layout, use the following line in your controller action:

$this->layout = false;

And if you only want to disable the view for this action, use the following line in your controller:

$this->render(false);

Note that using $this->layout = false; and $this->render(false); together in your controller action will give you the same results as $this->autoRender = false;

Comments on This Post

Be the first to comment on this post!

Post a Comment