CakePHP - Just Layout?
Posted
by
Kieran
on Stack Overflow
See other posts from Stack Overflow
or by Kieran
Published on 2011-09-02T15:10:20Z
Indexed on
2014/06/02
15:28 UTC
Read the original article
Hit count: 298
I want to set $this->layout
to json
in the controller action.
In the json
layout, there will be a line saying $this->Javascript>object();
which will parse through the data given to it by the controller, and output the jSON.
However, creating a new view file for each jSON request, eg. recipe_view
, ingredient_view
isn't necessary, I just need a layout.
Is there a way to bypass the view file altogether and have just the layout, without the notorious Missing View! error?
Many Thanks Kieran
© Stack Overflow or respective owner