I would like to render the view by itself, I want to avoid rendering the <head> and other sections defined in the default.ctp file.
I have the info that I want to render in an element:
<?php
echo $post['Post']['id'];
?>
How can I accomplish this? It is for an ajax response.
Thanks!
You can create a new layout (/app/views/layouts/ajax.ctp, for example) that contains:
Then in your controller, in the action you are using, define the layout:
Reference: http://book.cakephp.org/view/962/Page-related-Attribute-layout