<?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; faq</title>
	<atom:link href="http://cakebaker.42dh.com/tags/faq/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>How to remove the comment with the page execution time</title>
		<link>http://cakebaker.42dh.com/2008/09/04/how-to-remove-the-comment-with-the-page-execution-time/</link>
		<comments>http://cakebaker.42dh.com/2008/09/04/how-to-remove-the-comment-with-the-page-execution-time/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 07:06:56 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=784</guid>
		<description><![CDATA[If you look at the HTML source of pages generated with CakePHP, you will probably detect a comment with the page execution time after the &#60;/html&#62; tag that looks like: &#60;!-- 0.6885s --&#62; This comment is automatically added by Cake if the debug value in app/config/core.php is greater than 0. As long as you only [...]]]></description>
			<content:encoded><![CDATA[<p>If you look at the HTML source of pages generated with CakePHP, you will probably detect a comment with the page execution time after the &lt;/html&gt; tag that looks like:</p>
<pre>
<code>&lt;!-- 0.6885s --&gt;</code>
</pre>
<p>This comment is automatically added by Cake if the debug value in app/config/core.php is greater than 0. </p>
<p>As long as you only work with HTML in your views, this is no problem. But if you have to use a different format like <a href="http://www.json.org/">JSON</a>, you won&#8217;t love this comment and you have to get rid of it ;-)</p>
<p>There are two ways to accomplish this. </p>
<p>The first approach is to set the debug value to 0, for example in a single action, with:</p>
<pre>
<code>Configure::write('debug', 0);</code>
</pre>
<p>The other approach is to remove the code snippet which adds the comment with the page execution time. For this purpose open app/webroot/index.php, and at the end of the file remove the following code:</p>
<pre>
<code>if (Configure::read() &gt; 0) {
    echo "&lt;!-- " . round(getMicrotime() - $TIME_START, 4) . "s --&gt;";
}</code>
</pre>
<p>Happy baking!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/09/04/how-to-remove-the-comment-with-the-page-execution-time/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>How to get rid of &#8220;CakePHP: the PHP Rapid Development Framework&#8221; at the top of your pages</title>
		<link>http://cakebaker.42dh.com/2007/05/30/how-to-get-rid-of-cakephp-the-php-rapid-development-framework-at-the-top-of-your-pages/</link>
		<comments>http://cakebaker.42dh.com/2007/05/30/how-to-get-rid-of-cakephp-the-php-rapid-development-framework-at-the-top-of-your-pages/#comments</comments>
		<pubDate>Wed, 30 May 2007 09:02:19 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/30/how-to-get-rid-of-cakephp-the-php-rapid-development-framework-at-the-top-of-your-pages/</guid>
		<description><![CDATA[An often asked newbie question in the IRC channel is: How can I get rid of &#8220;CakePHP: the PHP Rapid Development Framework&#8221; at the top of my pages? This header is shown because you don&#8217;t have defined your own layout yet, and so the default layout is used which comes with CakePHP (located in /cake/libs/view/layouts/default.ctp [...]]]></description>
			<content:encoded><![CDATA[<p>An often asked newbie question in the IRC channel is: How can I get rid of &#8220;CakePHP: the PHP Rapid Development Framework&#8221; at the top of my pages? </p>
<p>This header is shown because you don&#8217;t have defined your own layout yet, and so the default layout is used which comes with CakePHP (located in /cake/libs/view/layouts/default.ctp <del datetime="2009-05-29T14:37:43+00:00">/cake/libs/view/templates/layouts/default.ctp (respectively .thtml with CakePHP 1.1)</del>). Now the first idea is to edit this file. That would work. But it violates the golden rule of CakePHP: <strong>Don&#8217;t edit files in the cake folder!</strong> So, instead you have to copy the file to /app/views/layouts. Then you can edit the layout in any way you want.</p>
<p>Happy baking :)</p>
<p>Update 2009-05-29: Fixed path to layout because it has changed since this article has been written. Thanks to Göran K. for the hint!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/05/30/how-to-get-rid-of-cakephp-the-php-rapid-development-framework-at-the-top-of-your-pages/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>What&#8217;s the release date of the stable version of CakePHP 1.2?</title>
		<link>http://cakebaker.42dh.com/2007/05/19/whats-the-release-date-of-the-stable-version-of-cakephp-12/</link>
		<comments>http://cakebaker.42dh.com/2007/05/19/whats-the-release-date-of-the-stable-version-of-cakephp-12/#comments</comments>
		<pubDate>Sat, 19 May 2007 09:16:26 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/19/whats-the-release-date-of-the-stable-version-of-cakephp-12/</guid>
		<description><![CDATA[That&#8217;s an often asked question, and no, I don&#8217;t know the answer to this question. But I know the reasons why there is no release date for the stable version of CakePHP 1.2 announced. One point is that CakePHP is a volunteer project, so it is almost impossible to predict what amount of work can [...]]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s an often asked question, and no, I don&#8217;t know the answer to this question. But I know the reasons why there is no release date for the stable version of CakePHP 1.2 announced. </p>
<p>One point is that CakePHP is a volunteer project, so it is almost impossible to predict what amount of work can be done during a certain time period, and hence it becomes difficult to say when it will be done. There are times with high activity (i.e. a lot of commits), but there are also times with almost no activity, see the <a href="https://trac.cakephp.org/timeline">time line</a> of trac to see that &#8220;pattern&#8221;.</p>
<p>Setting a release date also leads to expectations. People expect that you deliver on that date. If you cannot deliver, people start complaining. And if that happens too often, the project gets the image of being unreliable.</p>
<p>So we have to wait until it&#8217;s done :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/05/19/whats-the-release-date-of-the-stable-version-of-cakephp-12/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>How to enable/disable debug messages for a certain action</title>
		<link>http://cakebaker.42dh.com/2007/04/18/how-to-enabledisable-debug-messages-for-a-certain-action/</link>
		<comments>http://cakebaker.42dh.com/2007/04/18/how-to-enabledisable-debug-messages-for-a-certain-action/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 15:55:43 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/18/how-to-enabledisable-debug-messages-for-a-certain-action/</guid>
		<description><![CDATA[An often asked question in the CakePHP IRC channel is: &#8220;How can I enable [or disable] the debug messages for a certain action?&#8221; The answer to this question is simple (works in both CakePHP 1.1 and 1.2): function action() { Configure::write('debug', '2'); // do something } Please notice that the key must be in lowercase, [...]]]></description>
			<content:encoded><![CDATA[<p>An often asked question in the CakePHP IRC channel is: &#8220;How can I enable [or disable] the debug messages for a certain action?&#8221; The answer to this question is simple (works in both CakePHP 1.1 and 1.2):</p>
<pre>
function action() {
    Configure::write('debug', '2');

    // do something
}
</pre>
<p>Please notice that the key must be in lowercase, &#8216;DEBUG&#8217; won&#8217;t have the desired effect.</p>
<p>PS: I shut down the j.42dh.com password manager service as nobody used it ;-)  A slightly modified version of the application can be downloaded from <a href="http://apps.42dh.com/jumpjump">http://apps.42dh.com/jumpjump</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/04/18/how-to-enabledisable-debug-messages-for-a-certain-action/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>CakePHP reference projects</title>
		<link>http://cakebaker.42dh.com/2007/01/05/cakephp-reference-projects/</link>
		<comments>http://cakebaker.42dh.com/2007/01/05/cakephp-reference-projects/#comments</comments>
		<pubDate>Fri, 05 Jan 2007 16:48:18 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/01/05/cakephp-reference-projects/</guid>
		<description><![CDATA[An often asked question is &#8220;What projects are realized with CakePHP?&#8221;. As the wiki no longer exists (and with it the show case area where you could list your project(s)), I compiled a short list of projects which are in my opinion reference cake projects. Did I miss an important project?]]></description>
			<content:encoded><![CDATA[<p>An often asked question is &#8220;What projects are realized with CakePHP?&#8221;. As the wiki no longer exists (and with it the show case area where you could list your project(s)), I compiled a short <a href="http://cakebaker.42dh.com/cakephp-projects/">list of projects</a> which are in my opinion reference cake projects. Did I miss an important project?</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/01/05/cakephp-reference-projects/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Cannot send session cache limiter</title>
		<link>http://cakebaker.42dh.com/2006/10/30/cannot-send-session-cache-limiter/</link>
		<comments>http://cakebaker.42dh.com/2006/10/30/cannot-send-session-cache-limiter/#comments</comments>
		<pubDate>Mon, 30 Oct 2006 16:30:41 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[problem]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2006/10/30/cannot-send-session-cache-limiter/</guid>
		<description><![CDATA[An often asked (PHP) question in the CakePHP IRC channel is how to fix the problem which causes the following warning: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/dho/projects/test/trunk/app/controllers/users_controller.php:7) in /home/dho/projects/cake_1.2.x.x/cake/libs/session.php on line 131 It is a bit nasty. The warning points us to line 7 (the [...]]]></description>
			<content:encoded><![CDATA[<p>An often asked (PHP) question in the CakePHP IRC channel is how to fix the problem which causes the following warning:</p>
<pre>
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at
/home/dho/projects/test/trunk/app/controllers/users_controller.php:7) in /home/dho/projects/cake_1.2.x.x/cake/libs/session.php
on line 131
</pre>
<p>It is a bit nasty. The warning points us to line 7 (the last line). Hm, but line 7 looks correct, doesn&#8217;t it?</p>
<pre>
&lt;?php
    class UsersController extends AppController {
        var $uses = null;

        function edit() {}
    }
?&gt;&nbsp;
</pre>
<p>Well, if you mark line 7 with your mouse, you see that there is a space after the &#8220;&gt;&#8221; character. And this space is the cause of the warning. If you remove the space, the warning disappears.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2006/10/30/cannot-send-session-cache-limiter/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Model without table</title>
		<link>http://cakebaker.42dh.com/2006/09/14/model-without-table/</link>
		<comments>http://cakebaker.42dh.com/2006/09/14/model-without-table/#comments</comments>
		<pubDate>Thu, 14 Sep 2006 08:31:15 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2006/09/14/model-without-table/</guid>
		<description><![CDATA[It is one of those questions you hear often in the CakePHP channel: &#8220;How can I create a model without a table?&#8221; The answer is simple: class ModelWithoutTable extends AppModel { var $useTable = false; } Related post: A controller without a model]]></description>
			<content:encoded><![CDATA[<p>It is one of those questions you hear often in the CakePHP channel: &#8220;How can I create a model without a table?&#8221; The answer is simple:</p>
<pre>
class ModelWithoutTable extends AppModel
{
    var $useTable = false;
}
</pre>
<p>Related post: <a href="http://cakebaker.42dh.com/2006/02/01/a-controller-without-a-model/">A controller without a model</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2006/09/14/model-without-table/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Why are there two &#8220;vendors&#8221; folders in CakePHP?</title>
		<link>http://cakebaker.42dh.com/2006/08/11/why-are-there-two-vendors-folders-in-cakephp/</link>
		<comments>http://cakebaker.42dh.com/2006/08/11/why-are-there-two-vendors-folders-in-cakephp/#comments</comments>
		<pubDate>Fri, 11 Aug 2006 15:23:04 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>

		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=243</guid>
		<description><![CDATA[You probably noticed that there are two &#8220;vendors&#8221; folders in CakePHP: one is directly in the root and the other in the &#8220;app&#8221; folder. So, why are there two such folders? It is simple. The &#8220;vendors&#8221; folder in the &#8220;app&#8221; folder is for application-specifc third-party libraries whereas the other &#8220;vendors&#8221; folder is for libraries you [...]]]></description>
			<content:encoded><![CDATA[<p>You probably noticed that there are two &#8220;vendors&#8221; folders in CakePHP: one is directly in the root and the other in the &#8220;app&#8221; folder. So, why are there two such folders? It is simple. The &#8220;vendors&#8221; folder in the &#8220;app&#8221; folder is for application-specifc third-party libraries whereas the other &#8220;vendors&#8221; folder is for libraries you want to use in multiple applications. </p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2006/08/11/why-are-there-two-vendors-folders-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to apply a beforeFilter to certain actions only</title>
		<link>http://cakebaker.42dh.com/2006/08/03/how-to-apply-a-beforefilter-to-certain-actions-only/</link>
		<comments>http://cakebaker.42dh.com/2006/08/03/how-to-apply-a-beforefilter-to-certain-actions-only/#comments</comments>
		<pubDate>Thu, 03 Aug 2006 08:47:34 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=237</guid>
		<description><![CDATA[If you define a beforeFilter in your controller, it will be executed before each action. Sometimes, that behaviour is not desired, and you want to exclude an action from the application of the beforeFilter. The following simple example gives you an idea of how to accomplish that: // app/controllers/users_controller.php class UsersController extends AppController { function [...]]]></description>
			<content:encoded><![CDATA[<p>If you define a beforeFilter in your controller, it will be executed before each action. Sometimes, that behaviour is not desired, and you want to exclude an action from the application of the beforeFilter. The following simple example gives you an idea of how to accomplish that:</p>
<pre>
// app/controllers/users_controller.php
class UsersController extends AppController
{
    function beforeFilter()
    {
        if ($this-&gt;action != 'login')
        {
            // execute beforeFilter logic
        }
    }

    function login()
    {
        // do login
    }

    function edit($id)
    {
        // do edit
    }

    function delete($id)
    {
        // do delete
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2006/08/03/how-to-apply-a-beforefilter-to-certain-actions-only/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A controller without a model</title>
		<link>http://cakebaker.42dh.com/2006/02/01/a-controller-without-a-model/</link>
		<comments>http://cakebaker.42dh.com/2006/02/01/a-controller-without-a-model/#comments</comments>
		<pubDate>Wed, 01 Feb 2006 18:11:54 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=90</guid>
		<description><![CDATA[If you want to create a controller which does not use a model, you have to create your controller in the following way: // tested with CakePHP r1892 class MyController extends AppController { // var $uses = null; works too var $uses = array(); function index() { } } If you omit the &#8220;var $uses [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to create a controller which does not use a model, you have to create your controller in the following way:</p>
<pre>
// tested with CakePHP r1892
class MyController extends AppController
{
    // var $uses = null; works too
    var $uses = array();

    function index()
    {
    }
}
</pre>
<p>If you omit the &#8220;var $uses = array();&#8221; you will get a &#8220;missing model&#8221; error.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2006/02/01/a-controller-without-a-model/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
