<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Some CakePHP requestAction&#8230;.action</title>
	<atom:link href="http://www.mattephraim.com/blog/2007/11/06/some-cakephp-requestactionaction/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattephraim.com/blog/2007/11/06/some-cakephp-requestactionaction/</link>
	<description></description>
	<pubDate>Sun, 05 Feb 2012 12:09:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: trevelyan</title>
		<link>http://www.mattephraim.com/blog/2007/11/06/some-cakephp-requestactionaction/#comment-16555</link>
		<dc:creator>trevelyan</dc:creator>
		<pubDate>Sun, 07 Feb 2010 04:28:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattephraim.com/blog/2007/11/06/some-cakephp-requestactionaction/#comment-16555</guid>
		<description>We use it on Popup Chinese for caching. If you want to cache a page (or the elements on that page) but still have some dynamic content, the controller won't be run so your dynamic content either has to be stored in the Session or processed using a requestAction.</description>
		<content:encoded><![CDATA[<p>We use it on Popup Chinese for caching. If you want to cache a page (or the elements on that page) but still have some dynamic content, the controller won&#8217;t be run so your dynamic content either has to be stored in the Session or processed using a requestAction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Ephraim</title>
		<link>http://www.mattephraim.com/blog/2007/11/06/some-cakephp-requestactionaction/#comment-84</link>
		<dc:creator>Matthew Ephraim</dc:creator>
		<pubDate>Wed, 12 Mar 2008 19:15:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattephraim.com/blog/2007/11/06/some-cakephp-requestactionaction/#comment-84</guid>
		<description>Thanks for the feedback! That was actually my first big CakePHP project, so there are probably a lot of areas that could have been improved. 

I guess my reasoning behind doing it that way was that, by using requestAction() to load in the page I wanted to view, I could easily wrap any public page in the system with an outer template that had additional functionality for previewing templates with a minimal amount of additional code on the public pages.

The way I've done it on other sites, using other frameworks, is closer to the way you suggested. Typically, I put the additional content in the actual template, and have a flag that I check to determine if the additional preview content should wrap the template. Because the requestAction() option was there, I decided to try it out. In the future, I may avoid using requestAction() because, in general, I don't really like a lot of the issues that come up when using it.</description>
		<content:encoded><![CDATA[<p>Thanks for the feedback! That was actually my first big CakePHP project, so there are probably a lot of areas that could have been improved. </p>
<p>I guess my reasoning behind doing it that way was that, by using requestAction() to load in the page I wanted to view, I could easily wrap any public page in the system with an outer template that had additional functionality for previewing templates with a minimal amount of additional code on the public pages.</p>
<p>The way I&#8217;ve done it on other sites, using other frameworks, is closer to the way you suggested. Typically, I put the additional content in the actual template, and have a flag that I check to determine if the additional preview content should wrap the template. Because the requestAction() option was there, I decided to try it out. In the future, I may avoid using requestAction() because, in general, I don&#8217;t really like a lot of the issues that come up when using it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TechSteve</title>
		<link>http://www.mattephraim.com/blog/2007/11/06/some-cakephp-requestactionaction/#comment-83</link>
		<dc:creator>TechSteve</dc:creator>
		<pubDate>Wed, 12 Mar 2008 19:05:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattephraim.com/blog/2007/11/06/some-cakephp-requestactionaction/#comment-83</guid>
		<description>Hi Matthew,

I think your design is pretty smart. However, as a developer with negative view of the function 'requestAction()', I would like to use aother way to solve the preview issue. Since the page to be previewed will possibly be an actual page, you may just give out the link of the preview action as the same as the actual url and pass the template id. The template id could be passed through session, database, or any mutually accessible places. The layout (or template) could be set on the fly. In the action of the controller, you may check whether the template is set. If so, change the value of $this-&#62;layout; otherwise, the page will be rendered using the default layout.

BTW, the site you made is pretty nice.

Steve</description>
		<content:encoded><![CDATA[<p>Hi Matthew,</p>
<p>I think your design is pretty smart. However, as a developer with negative view of the function &#8216;requestAction()&#8217;, I would like to use aother way to solve the preview issue. Since the page to be previewed will possibly be an actual page, you may just give out the link of the preview action as the same as the actual url and pass the template id. The template id could be passed through session, database, or any mutually accessible places. The layout (or template) could be set on the fly. In the action of the controller, you may check whether the template is set. If so, change the value of $this-&gt;layout; otherwise, the page will be rendered using the default layout.</p>
<p>BTW, the site you made is pretty nice.</p>
<p>Steve</p>
]]></content:encoded>
	</item>
</channel>
</rss>

