<?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>cakebaker &#187; controller</title>
	<atom:link href="http://cakebaker.42dh.com/tags/controller/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Mon, 19 Jul 2010 14:23:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Specifying helpers for static pages</title>
		<link>http://cakebaker.42dh.com/2009/06/01/specifying-helpers-for-static-pages/</link>
		<comments>http://cakebaker.42dh.com/2009/06/01/specifying-helpers-for-static-pages/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 07:19:10 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[helper]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1201</guid>
		<description><![CDATA[In a recent comment I got asked how you can reference Javascript files from static pages (i.e. from files in app/views/pages) as &#8220;you can&#8217;t add the JavaScript helper, because there isn&#8217;t a controller&#8221;. Well, the assumption that there is no controller is wrong. There is one, the PagesController, though by default it is &#8220;hidden&#8221; in [...]]]></description>
			<content:encoded><![CDATA[<p>In a recent <a href="http://cakebaker.42dh.com/2007/02/21/referencing-javascript-files/#comment-129496">comment</a> I got asked how you can reference Javascript files from static pages (i.e. from files in app/views/pages) as &#8220;you can&#8217;t add the JavaScript helper, because there isn&#8217;t a controller&#8221;.</p>
<p>Well, the assumption that there is no controller is wrong. There is one, the PagesController, though by default it is &#8220;hidden&#8221; in cake/libs/controller (unless you baked your project with the bake script, then you will also find a PagesController in app/controllers).</p>
<p>And this means you can specify the helpers you want to use in your static pages in the usual way: by adding them to the $helpers array of the PagesController resp. the AppController (app/app_controller.php), if you want to use the helpers in the views of more than one controller. Please do not edit the PagesController in the cake/libs/controller directory, but copy it to app/controllers and make the changes there.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/06/01/specifying-helpers-for-static-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create an instance of a controller</title>
		<link>http://cakebaker.42dh.com/2008/11/26/how-to-create-an-instance-of-a-controller/</link>
		<comments>http://cakebaker.42dh.com/2008/11/26/how-to-create-an-instance-of-a-controller/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 09:52:39 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=975</guid>
		<description><![CDATA[Usually you do not have to care about the instantiation of controllers, it is done automatically for you by CakePHP. Though, in some cases it might be necessary to do it manually, at least I saw some people who tried it and failed. So, how do you do it? The obvious way is to use [...]]]></description>
			<content:encoded><![CDATA[<p>Usually you do not have to care about the instantiation of controllers, it is done automatically for you by CakePHP. Though, in some cases it might be necessary to do it manually, at least I saw some people who tried it and failed. So, how do you do it? </p>
<p>The obvious way is to use the following approach:</p>
<pre>
<code>$myController = new ExampleController();
$myController-&gt;test();</code>
</pre>
<p>If you are &#8220;lucky&#8221; and you do not use components or models in the called method, then the snippet above works fine. In the other case, you will get a &#8220;Call to a member function on a non-object&#8221; error. </p>
<p>The reason for this error is that the models and components used by the controller are not constructed when you create a new instance of the controller. For this purpose you have to call the constructClasses() method before you use any controller methods. We can now rewrite the example from above to:</p>
<pre>
<code>$myController = new ExampleController();
$myController-&gt;constructClasses();
$myController-&gt;test();</code>
</pre>
<p>This probably works in most cases. I say &#8220;probably&#8221;, because if the used components use callback methods like initialize() or startUp(), then you have to call those callbacks yourself. The same is true if you want to use the beforeFilter() and afterFilter() callbacks in your controller. </p>
<p>Here an example with calling the initialize() callback method of the components (&#8220;Component&#8221; is misnamed, it is in fact a container which contains all components a controller uses):</p>
<pre>
<code>$myController = new ExampleController();
$myController-&gt;constructClasses();
$myController-&gt;Component-&gt;initialize($myController);
$myController-&gt;test();</code>
</pre>
<p>This is a bit ugly, because you have to know implementation details of the controller you shouldn&#8217;t have to know&#8230;</p>
<p>Anyway, if you are interested in the complete instantiation and initialization process of a controller, have a look at Dispatcher::dispatch() and Dispatcher::_invoke().</p>
<p>This leads us to an alternative to the instantiation of a controller: to use a controller method indirectly by using Dispatcher::dispatch(). The example would then look like:</p>
<pre>
<code>$dispatcher = new Dispatcher();
$dispatcher-&gt;dispatch('/example/test');</code>
</pre>
<p>It depends on your specific use case whether this is a possible alternative, as with this approach you no longer have direct access to the respective controller.</p>
<p>Anyway, happy baking!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/11/26/how-to-create-an-instance-of-a-controller/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Screencast about testing controllers with CakePHP</title>
		<link>http://cakebaker.42dh.com/2008/11/03/screencast-about-testing-controllers-with-cakephp/</link>
		<comments>http://cakebaker.42dh.com/2008/11/03/screencast-about-testing-controllers-with-cakephp/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 08:28:21 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=925</guid>
		<description><![CDATA[Yesterday I stumbled upon a screencast by Fernando Baraja (aka FernyB), in which he gives an introduction about testing controllers with CakePHP (you can skip the first few minutes because they are about installing CakePHP). This screencast seems to be the start of a series of CakePHP screencasts. You can find additional information about testing [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I stumbled upon a <a href="http://fernyb.net/blog/2008/11/01/testing-with-cakephp-part-1/">screencast</a> by <a href="http://fernyb.net/blog/">Fernando Baraja</a> (aka FernyB), in which he gives an introduction about testing controllers with CakePHP (you can skip the first few minutes because they are about installing CakePHP). This screencast seems to be the start of a series of CakePHP screencasts.</p>
<p>You can find additional information about <a href="http://book.cakephp.org/view/366/Testing-controllers">testing controllers</a> in the cookbook.</p>
<p>Happy testing :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/11/03/screencast-about-testing-controllers-with-cakephp/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>An alternative to requestAction</title>
		<link>http://cakebaker.42dh.com/2008/08/20/an-alternative-to-requestaction/</link>
		<comments>http://cakebaker.42dh.com/2008/08/20/an-alternative-to-requestaction/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 12:33:22 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=717</guid>
		<description><![CDATA[While reading Felix&#8217; article &#8220;requestAction considered harmful&#8221; I asked myself: &#8220;Hey, why don&#8217;t we just instantiate the respective controller and call the action directly?&#8221; And that&#8217;s what I did. Here is the result: public function index() { App::import('Controller', 'Example'); $example = new ExampleController(); $example-&#62;constructClasses(); $foo = $example-&#62;getFoo(); // do something with $foo } The only [...]]]></description>
			<content:encoded><![CDATA[<p>While reading Felix&#8217; article &#8220;<a href="http://debuggable.com/posts/requestaction-considered-harmful:48abb514-1f9c-4443-b91c-6d0f4834cda3">requestAction considered harmful</a>&#8221; I asked myself: &#8220;Hey, why don&#8217;t we just instantiate the respective controller and call the action directly?&#8221;</p>
<p>And that&#8217;s what I did. Here is the result:</p>
<pre>
<code>public function index() {
    App::import('Controller', 'Example');
    $example = new ExampleController();
    $example-&gt;constructClasses();
    $foo = $example-&gt;getFoo();
    // do something with $foo
}</code>
</pre>
<p>The only &#8220;difficulty&#8221; is that you have to &#8220;manually&#8221; load the models and components used by the respective controller with constructClasses().</p>
<p>It seems to work fine and it is faster than requestAction, but it is possible that some callback methods are not called (at least the shutdown() callback of components is not called). So, be careful with this approach. And think twice before using this approach or requestAction ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/08/20/an-alternative-to-requestaction/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>An alternative approach for static pages</title>
		<link>http://cakebaker.42dh.com/2008/06/18/an-alternative-approach-for-static-pages/</link>
		<comments>http://cakebaker.42dh.com/2008/06/18/an-alternative-approach-for-static-pages/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 09:21:14 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[ideas]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=615</guid>
		<description><![CDATA[A while ago Jonathan Snook showed in the article Easier static pages with CakePHP 1.2 how you can easily create static pages by creating view files without corresponding controller actions. For this purpose he wrote a custom error handler. The &#8220;problem&#8221; of this approach is that an error handler is meant to show error messages, [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago <a href="http://snook.ca/jonathan">Jonathan Snook</a> showed in the article <a href="http://snook.ca/archives/cakephp/static_pages_cakephp12/">Easier static pages with CakePHP 1.2</a> how you can easily create static pages by creating view files without corresponding controller actions. For this purpose he wrote a custom error handler. The &#8220;problem&#8221; of this approach is that an error handler is meant to show error messages, and not static pages&#8230;</p>
<p>And so I looked for a different approach and ended up with a modified PagesController, combined with a route. The idea is to use the convention that each file in app/views/pages can be accessed like example.com/file (i.e. about.ctp is accessed as example.com/about and about/company.ctp as example.com/about/company). </p>
<p>Here is the PagesController:</p>
<pre>
// app/controllers/pages_controller.php
class PagesController extends AppController{
    public $uses = array();

    public function display() {
        $viewFilename = array_pop($this-&gt;params['pass']) . '.ctp';
        $viewFilename = str_replace('-', '_', $viewFilename);

        $viewPath =  DS . $viewFilename;
        if ($this-&gt;params['pass']) {
            $viewPath = DS . implode(DS, $this-&gt;params['pass']) . $viewPath;
        }

        if (file_exists(VIEWS.'pages'.$viewPath)) {
            $this-&gt;render(null, null, VIEWS.'pages'.$viewPath);
        } else {
            $this-&gt;cakeError('error404');
        }
    }
}
</pre>
<p>To get the aforementioned URL scheme we have to define a &#8220;catch all&#8221; route in app/config/routes.php:</p>
<pre>
Router::connect('*', array('controller' =&gt; 'pages', 'action' =&gt; 'display'));
</pre>
<p>This route has to be the latest route in the routes file. And that&#8217;s also the disadvantage of this approach: because of the &#8220;catch all&#8221; route you have to define routes for all controllers&#8230;</p>
<p>Anyway, I hope this approach is useful for some of you :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/06/18/an-alternative-approach-for-static-pages/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Setting the page title</title>
		<link>http://cakebaker.42dh.com/2008/05/28/setting-the-page-title/</link>
		<comments>http://cakebaker.42dh.com/2008/05/28/setting-the-page-title/#comments</comments>
		<pubDate>Wed, 28 May 2008 08:27:13 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=607</guid>
		<description><![CDATA[If you want to set the title of a page, you have three different ways to accomplish that. The first two approaches use the magic variable &#8220;title_for_layout&#8221; to set the title in the layout: &#60;title&#62; &#60;?php echo $title_for_layout;?&#62; &#60;/title&#62; You can set the value for this magic variable either in the controller: public $pageTitle = [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to set the title of a page, you have three different ways to accomplish that. </p>
<p>The first two approaches use the magic variable &#8220;title_for_layout&#8221; to set the title in the layout:</p>
<pre>
&lt;title&gt;
    &lt;?php echo $title_for_layout;?&gt;
&lt;/title&gt;
</pre>
<p>You can set the value for this magic variable either in the controller:</p>
<pre>
public $pageTitle = 'The title';  // same title for all actions

or

public function test() {
    $this-&gt;pageTitle = 'The title';
    ...
}
</pre>
<p>or in the view file:</p>
<pre>
&lt;?php $this-&gt;pageTitle = 'The title';?&gt;
...
</pre>
<p>The third, and last, approach uses a custom variable in the layout instead of the magic variable:</p>
<pre>
&lt;title&gt;
    &lt;?php echo $pageTitle;?&gt;
&lt;/title&gt;
</pre>
<p>Its value is then set in the controller, in the same way you put other data to the view:</p>
<pre>
public function test() {
    ...
    $this-&gt;set('pageTitle', 'The title');
}
</pre>
<p>Now, which approach should you use? I think it is a matter of preference. From a conceptual point of view I prefer the third approach as it doesn&#8217;t use any magic, but in practice I usually use the second (maybe this will change after this article *g*). The first approach I consider as a bad practice, because a controller doesn&#8217;t represent a page and hence it shouldn&#8217;t have a pageTitle property. </p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/05/28/setting-the-page-title/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Detect the rendering of an error page</title>
		<link>http://cakebaker.42dh.com/2008/03/15/detect-the-rendering-of-an-error-page/</link>
		<comments>http://cakebaker.42dh.com/2008/03/15/detect-the-rendering-of-an-error-page/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 15:31:46 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/15/detect-the-rendering-of-an-error-page/</guid>
		<description><![CDATA[Yesterday, I ran into an endless loop in NoseRub while trying to run the migrations to set up the necessary tables. After debugging a while I found the cause for the endless loop: in the beforeRender() method of the AppController we create a model, and as there were no tables at that time, this failed [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I ran into an endless loop in <a href="http://noserub.com">NoseRub</a> while trying to run the migrations to set up the necessary tables. After debugging a while I found the cause for the endless loop: in the beforeRender() method of the AppController we create a model, and as there were no tables at that time, this failed and caused a &#8220;missing table&#8221; error. Usually, the corresponding error page is then rendered. And that&#8217;s it. But not in this case, due to a &#8220;feature&#8221; I was not aware of: before an error page is rendered, the beforeRender() method of the AppController is called. In this case, it caused again a &#8220;missing table&#8221; error, and so you have the loop ;-)</p>
<p>To prevent this effect, we have to detect the type of view which is rendered. The only way I found to accomplish this, is to check the viewPath, as shown in the following snippet:</p>
<pre>
// in app/app_controller.php
public function beforeRender() {
    if ($this-&gt;viewPath != 'errors') {
        // no error page
    }
}
</pre>
<p>It is probably rather rare you have to use this, but maybe it is useful for some.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/03/15/detect-the-rendering-of-an-error-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faster baking with bake</title>
		<link>http://cakebaker.42dh.com/2007/12/28/faster-baking-with-bake/</link>
		<comments>http://cakebaker.42dh.com/2007/12/28/faster-baking-with-bake/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 12:27:59 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[bake]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/12/28/faster-baking-with-bake/</guid>
		<description><![CDATA[Some time ago some shortcuts were added to the bake script to make it possible to skip all those questions the bake script usually asks: cake bake model User cake bake controller Users scaffold cake bake view Users For more details on those shortcuts call the bake script with the help parameter like: cake bake [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago some shortcuts were added to the bake script to make it possible to skip all those questions the bake script usually asks:</p>
<pre>
cake bake model User
cake bake controller Users scaffold
cake bake view Users
</pre>
<p>For more details on those shortcuts call the bake script with the help parameter like:</p>
<pre>
cake bake model help
</pre>
<p>or have a look at <a href="http://cakebaker.42dh.com/2007/06/06/faster-baking-of-controllers-with-the-bake-shell-script/">Faster baking of controllers with the bake shell script</a> and <a href="http://cakebaker.42dh.com/2007/06/11/baking-views/">Baking views</a>.</p>
<p>Recently, a new shortcut was added which makes the aforementioned shortcuts (almost) obsolete. With the &#8220;all&#8221; parameter it is now possible to bake with one command a model plus the corresponding controller with its views:</p>
<pre>
cake bake all  // asks you for the model name
cake bake all User
</pre>
<p>This feature is currently only available in the development branch, but the next release is probably not that far away&#8230;</p>
<p>Happy baking :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/12/28/faster-baking-with-bake/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>A small change in Controller::redirect()</title>
		<link>http://cakebaker.42dh.com/2007/12/24/a-small-change-in-controllerredirect/</link>
		<comments>http://cakebaker.42dh.com/2007/12/24/a-small-change-in-controllerredirect/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 07:16:15 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[feature]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/12/24/a-small-change-in-controllerredirect/</guid>
		<description><![CDATA[If you wanted to stop the program execution after a redirect you had to use the code shown below up to now: $this-&#62;redirect('/controller/action', null, true); or $this-&#62;redirect('/controller/action'); exit(); Thanks to a recent change of the API of the &#8220;redirect&#8221; method &#8212; the default value for the $exit parameter was changed from &#8220;false&#8221; to &#8220;true&#8221; &#8212; [...]]]></description>
			<content:encoded><![CDATA[<p>If you wanted to stop the program execution after a redirect you had to use the code shown below up to now:</p>
<pre>
$this-&gt;redirect('/controller/action', null, true);

or

$this-&gt;redirect('/controller/action');
exit();
</pre>
<p>Thanks to a recent <a href="https://trac.cakephp.org/changeset/6208">change</a> of the API of the &#8220;redirect&#8221; method &#8212; the default value for the $exit parameter was changed from &#8220;false&#8221; to &#8220;true&#8221; &#8212; you can now simply use:</p>
<pre>
$this-&gt;redirect('/controller/action');
</pre>
<p>As it does an exit() by default, you can no longer encounter a possible security hole I described in <a href="http://cakebaker.42dh.com/2006/08/28/dont-forget-to-exit-after-a-redirect/">Don&#8217;t forget to exit after a redirect</a> (well, theoretically you can still encounter it when setting the $exit parameter explicitly to &#8220;false&#8221;, but that&#8217;s rather unlikely I think).</p>
<p>Merry Christmas to everyone!</p>
<p>PS: From the activity in the repository it looks like the Cake team is baking a Christmas Cake :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/12/24/a-small-change-in-controllerredirect/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Rendering elements from controllers</title>
		<link>http://cakebaker.42dh.com/2007/12/21/rendering-elements-from-controllers/</link>
		<comments>http://cakebaker.42dh.com/2007/12/21/rendering-elements-from-controllers/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 08:06:41 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/12/21/rendering-elements-from-controllers/</guid>
		<description><![CDATA[If you work with Ajax you probably encountered situations when it would have been handy if you could render an element directly from the controller. But that was not possible. You had to use a view, and then from there you could render the element with renderElement(). In the meantime this feature has been added [...]]]></description>
			<content:encoded><![CDATA[<p>If you work with Ajax you probably encountered situations when it would have been handy if you could render an element directly from the controller. But that was not possible. You had to use a view, and then from there you could render the element with renderElement().</p>
<p>In the meantime this feature has been added to the development branch (I don&#8217;t know when) as I learned today from a <a href="https://trac.cakephp.org/ticket/3132#comment:4">comment</a> by gwoo.</p>
<p>If you have an element /app/views/elements/example.ctp in your application, then you can render it with the following code snippet from within your controller:</p>
<pre>
$this-&gt;render('/elements/example');
</pre>
<p>In the same way you can also render views which belong to other controllers.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/12/21/rendering-elements-from-controllers/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
	</channel>
</rss>
