<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Writing a custom error handler</title>
	<atom:link href="http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:12:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-191711</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sun, 20 Feb 2011 16:01:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-191711</guid>
		<description>@anonimo: Thanks for your snippet for setting a special error layout!</description>
		<content:encoded><![CDATA[<p>@anonimo: Thanks for your snippet for setting a special error layout!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonimo</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-190559</link>
		<dc:creator>anonimo</dc:creator>
		<pubDate>Sat, 12 Feb 2011 02:15:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-190559</guid>
		<description>First, create a new layout and call it error.ctp (place in the app/views/layouts, of course).

Then add this to your Class AppController:
&lt;pre&gt;
&lt;code&gt;
// app/app_controller.php

function beforeRender () {
   $this-&gt;_setErrorLayout();
}

function _setErrorLayout() {
   if($this-&gt;name == &#039;CakeError&#039;) {
       $this-&gt;layout = &#039;error&#039;;
   }
}
&lt;/code&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>First, create a new layout and call it error.ctp (place in the app/views/layouts, of course).</p>
<p>Then add this to your Class AppController:</p>
<pre>
<pre><code>// app/app_controller.php

function beforeRender () {
   $this-&gt;_setErrorLayout();
}

function _setErrorLayout() {
   if($this-&gt;name == 'CakeError') {
       $this-&gt;layout = 'error';
   }
}</code></pre>
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-153673</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 23 Mar 2010 15:50:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-153673</guid>
		<description>@pokoot: Hm, $this-&gt;controller-&gt;Session-&gt;read(&#039;key&#039;); doesn&#039;t work?</description>
		<content:encoded><![CDATA[<p>@pokoot: Hm, $this-&gt;controller-&gt;Session-&gt;read(&#8216;key&#8217;); doesn&#8217;t work?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pokoot</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-153426</link>
		<dc:creator>pokoot</dc:creator>
		<pubDate>Mon, 22 Mar 2010 11:58:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-153426</guid>
		<description>DOes anyone here know how to access the session variables on error handler?

I have tried a lot of things like app import session and still no luck. Tried even $_SESSION[&#039;var_name&#039;] and still no luck.

Your solution is much appreciated. 

Thank you!</description>
		<content:encoded><![CDATA[<p>DOes anyone here know how to access the session variables on error handler?</p>
<p>I have tried a lot of things like app import session and still no luck. Tried even $_SESSION['var_name'] and still no luck.</p>
<p>Your solution is much appreciated. </p>
<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-119094</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sat, 31 Jan 2009 15:50:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-119094</guid>
		<description>@Carlos: Thanks for the hint! I modified the article so it now works with CakePHP 1.2, too. With those changes, the error should disappear. Good luck!</description>
		<content:encoded><![CDATA[<p>@Carlos: Thanks for the hint! I modified the article so it now works with CakePHP 1.2, too. With those changes, the error should disappear. Good luck!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-119087</link>
		<dc:creator>Carlos</dc:creator>
		<pubDate>Sat, 31 Jan 2009 12:50:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-119087</guid>
		<description>Does anyone has problems with the code? i&#039;m getting a error on:
            $this-&gt;__dispatch-&gt;start($this-&gt;controller);</description>
		<content:encoded><![CDATA[<p>Does anyone has problems with the code? i&#8217;m getting a error on:<br />
            $this-&gt;__dispatch-&gt;start($this-&gt;controller);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-105621</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sat, 06 Sep 2008 15:31:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-105621</guid>
		<description>@handsofaten: What happens if you comment out those calls to the Html helper? My guess is that the Html helper doesn&#039;t get loaded and that this causes the blank page.

Btw: Which version of cake do you use?</description>
		<content:encoded><![CDATA[<p>@handsofaten: What happens if you comment out those calls to the Html helper? My guess is that the Html helper doesn&#8217;t get loaded and that this causes the blank page.</p>
<p>Btw: Which version of cake do you use?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: handsofaten</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-105319</link>
		<dc:creator>handsofaten</dc:creator>
		<pubDate>Thu, 04 Sep 2008 17:56:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-105319</guid>
		<description>typical header stuff:

echo $html-&gt;charset();
echo $html-&gt;meta(&#039;icon&#039;);

echo $html-&gt;css(&#039;bluestar&#039;);
echo $html-&gt;css(&#039;lightbox&#039;);

echo $scripts_for_layout;</description>
		<content:encoded><![CDATA[<p>typical header stuff:</p>
<p>echo $html-&gt;charset();<br />
echo $html-&gt;meta(&#8216;icon&#8217;);</p>
<p>echo $html-&gt;css(&#8216;bluestar&#8217;);<br />
echo $html-&gt;css(&#8216;lightbox&#8217;);</p>
<p>echo $scripts_for_layout;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-105303</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 04 Sep 2008 16:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-105303</guid>
		<description>@handsofaten: What follows after the closed title tag in your layout?</description>
		<content:encoded><![CDATA[<p>@handsofaten: What follows after the closed title tag in your layout?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: handsofaten</title>
		<link>http://cakebaker.42dh.com/2006/06/15/writing-a-custom-error-handler/comment-page-1/#comment-105108</link>
		<dc:creator>handsofaten</dc:creator>
		<pubDate>Wed, 03 Sep 2008 02:06:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=209#comment-105108</guid>
		<description>Thanks for the reply, baker. No, $content_for_layout is there. It prints $title_for_layout as &quot;Errors&quot;, closes the title tag, and then stops. All I really want is a simple 404 message.</description>
		<content:encoded><![CDATA[<p>Thanks for the reply, baker. No, $content_for_layout is there. It prints $title_for_layout as &#8220;Errors&#8221;, closes the title tag, and then stops. All I really want is a simple 404 message.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

