<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rick Guyer .com &#187; view</title>
	<atom:link href="http://rickguyer.com/tag/view/feed/" rel="self" type="application/rss+xml" />
	<link>http://rickguyer.com</link>
	<description>Information about the web, web development, and technology.</description>
	<lastBuildDate>Sat, 03 Jul 2010 19:52:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reusing controller views in CakePHP</title>
		<link>http://rickguyer.com/reusing-controller-views-in-cakephp/</link>
		<comments>http://rickguyer.com/reusing-controller-views-in-cakephp/#comments</comments>
		<pubDate>Sat, 02 May 2009 15:50:36 +0000</pubDate>
		<dc:creator>ricog</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://rickguyer.com/?p=37</guid>
		<description><![CDATA[CakePHP makes it easy to reuse your small blocks of presentation code throughout your application by using Elements. You can read more about them here:
http://book.cakephp.org/view/97/Elements
Sometimes though you want to reuse a regular controller view without moving the code to an element. In fact, if the view code is specific to the controller, it is good [...]]]></description>
			<content:encoded><![CDATA[<p>CakePHP makes it easy to reuse your small blocks of presentation code throughout your application by using <a href="http://book.cakephp.org/view/97/Elements">Elements</a>. You can read more about them here:</p>
<p><a href="http://book.cakephp.org/view/97/Elements">http://book.cakephp.org/view/97/Elements</a></p>
<p>Sometimes though you want to reuse a regular controller view without moving the code to an element. In fact, if the view code is specific to the controller, it is good practice to keep it in the controller view.</p>
<p>Fortunately this is fairly simple. Just create the view and then reference it like this:</p>
<pre class="brush: php">
&lt;?php echo $this-&gt;element(&#039;../projects/menu&#039;); ?&gt;
</pre>
<p><em>In the example above, I&#8217;m accessing the following file: /views/projects/menu.ctp</em></p>
<p>As always, the element will have access to all existing view variables (t<em>he ones typically passed using $this-&gt;set()</em>).</p>
]]></content:encoded>
			<wfw:commentRss>http://rickguyer.com/reusing-controller-views-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
