<?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: Questions regarding the latest tutorial (1.3.0)</title>
	<atom:link href="http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/feed/" rel="self" type="application/rss+xml" />
	<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/</link>
	<description>Developing PHP and XUL Software in the Real World</description>
	<pubDate>Thu, 28 Aug 2008 14:27:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Kyle</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9226</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Mon, 09 Apr 2007 10:51:39 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9226</guid>
		<description>Hi,

I mashed together your NoRoute and bigroom.co.uk's and I did end up using ReflectionClass. Do you have any idea what kind of performance hit this may have in big projects? With catching the exception, the 404 code would only be executed if it doesn't exist in the first place, but using reflection it's done every time. It is, however, nice to have all the 404 stuff contained in one nice plugin.

Sometimes I put private functions in my controllers, like little helpers that really don't deserve to go elsewhere (e.g. filtering and validating the same post/get data on multiple actions). To display a 404 for private functions you have to then also use ReflectionMethod. But, although this may have been obvious, I noticed a better way to hide protected functions in controllers.

Don't do:
private function validateAction()

Do:
private function validate()

Because there's no Action at the end, to the dispatcher (and how I used ReflectionClass) it looks like it doesn't exist at all. Now I just need to make sure that I don't add "Action" to the end of method names out of habit (which is why it took me so long to notice this feature in the first place).</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I mashed together your NoRoute and bigroom.co.uk's and I did end up using ReflectionClass. Do you have any idea what kind of performance hit this may have in big projects? With catching the exception, the 404 code would only be executed if it doesn't exist in the first place, but using reflection it's done every time. It is, however, nice to have all the 404 stuff contained in one nice plugin.</p>
<p>Sometimes I put private functions in my controllers, like little helpers that really don't deserve to go elsewhere (e.g. filtering and validating the same post/get data on multiple actions). To display a 404 for private functions you have to then also use ReflectionMethod. But, although this may have been obvious, I noticed a better way to hide protected functions in controllers.</p>
<p>Don't do:<br />
private function validateAction()</p>
<p>Do:<br />
private function validate()</p>
<p>Because there's no Action at the end, to the dispatcher (and how I used ReflectionClass) it looks like it doesn't exist at all. Now I just need to make sure that I don't add "Action" to the end of method names out of habit (which is why it took me so long to notice this feature in the first place).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob...</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9221</link>
		<dc:creator>Rob...</dc:creator>
		<pubDate>Mon, 09 Apr 2007 05:33:42 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9221</guid>
		<description>Hi Kyle,

You could probably do some reflection to work out if the action function exists in the controller class.

It's easier to catch the exception to be honest :)

Regards,

Rob...</description>
		<content:encoded><![CDATA[<p>Hi Kyle,</p>
<p>You could probably do some reflection to work out if the action function exists in the controller class.</p>
<p>It's easier to catch the exception to be honest :)</p>
<p>Regards,</p>
<p>Rob&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9205</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Sun, 08 Apr 2007 10:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9205</guid>
		<description>Rob, I came across your noroute plugin AkCom_Controller_Plugin_NoRoute.

Is there an easy way to make this work with non existent actions as well, rather than a __call in every controller?

Instead of using a plugin I've thought about catching exceptions from dispatch() but that's just not as nice.</description>
		<content:encoded><![CDATA[<p>Rob, I came across your noroute plugin AkCom_Controller_Plugin_NoRoute.</p>
<p>Is there an easy way to make this work with non existent actions as well, rather than a __call in every controller?</p>
<p>Instead of using a plugin I've thought about catching exceptions from dispatch() but that's just not as nice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob...</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9020</link>
		<dc:creator>Rob...</dc:creator>
		<pubDate>Thu, 29 Mar 2007 18:37:13 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9020</guid>
		<description>Denis,

In these cases, don't use initView() 

:)

Regards,

Rob...</description>
		<content:encoded><![CDATA[<p>Denis,</p>
<p>In these cases, don't use initView() </p>
<p>:)</p>
<p>Regards,</p>
<p>Rob&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob...</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9018</link>
		<dc:creator>Rob...</dc:creator>
		<pubDate>Thu, 29 Mar 2007 18:31:38 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9018</guid>
		<description>Thanks Ludo,

Regards,

Rob...</description>
		<content:encoded><![CDATA[<p>Thanks Ludo,</p>
<p>Regards,</p>
<p>Rob&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ludo</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9007</link>
		<dc:creator>Ludo</dc:creator>
		<pubDate>Thu, 29 Mar 2007 08:06:36 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-9007</guid>
		<description>There is an error here :

zf-tutorial/application/views/indexDelete.tpl.php

become :
 zf-tutorial/application/views/scripts/index/delete.phtml</description>
		<content:encoded><![CDATA[<p>There is an error here :</p>
<p>zf-tutorial/application/views/indexDelete.tpl.php</p>
<p>become :<br />
 zf-tutorial/application/views/scripts/index/delete.phtml</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis Soloshenko</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-8994</link>
		<dc:creator>Denis Soloshenko</dc:creator>
		<pubDate>Wed, 28 Mar 2007 21:59:51 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-8994</guid>
		<description>Rob,

Seems It will not work.

Part of code from initView() method:
"
$baseDir = dirname($dirs[$module]) . DIRECTORY_SEPARATOR . 'views';
        if (!file_exists($baseDir) &#124;&#124; !is_dir($baseDir)) {
            throw new Zend_Controller_Exception('Missing base view directory ("' . $baseDir . '")');
        }
"

So, Zend expect that the view directory must by in subdirectory 'view' in the same directory where controller placed(and it generates exception in other case). It can be a little bit inconveniently in some projects, I think.</description>
		<content:encoded><![CDATA[<p>Rob,</p>
<p>Seems It will not work.</p>
<p>Part of code from initView() method:<br />
"<br />
$baseDir = dirname($dirs[$module]) . DIRECTORY_SEPARATOR . 'views';<br />
        if (!file_exists($baseDir) || !is_dir($baseDir)) {<br />
            throw new Zend_Controller_Exception('Missing base view directory ("' . $baseDir . '")');<br />
        }<br />
"</p>
<p>So, Zend expect that the view directory must by in subdirectory 'view' in the same directory where controller placed(and it generates exception in other case). It can be a little bit inconveniently in some projects, I think.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ludo</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-8991</link>
		<dc:creator>Ludo</dc:creator>
		<pubDate>Wed, 28 Mar 2007 13:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-8991</guid>
		<description>use route ena  $this-&#62;url(array(),"routeName") to make the path on link instead of $this-&#62;baseUrl."controller/action"</description>
		<content:encoded><![CDATA[<p>use route ena  $this-&gt;url(array(),"routeName") to make the path on link instead of $this-&gt;baseUrl."controller/action"</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob...</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-8985</link>
		<dc:creator>Rob...</dc:creator>
		<pubDate>Wed, 28 Mar 2007 05:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-8985</guid>
		<description>Denis,

What I mean is that the call to $this-&gt;initView() in the action's init() handles setting up the path to the view templates. 

I don't see why you can't override it with a call to $this-&gt;view-&gt;setScriptPath() after the call to $this-&gt;initView() though.

Regards,

Rob...</description>
		<content:encoded><![CDATA[<p>Denis,</p>
<p>What I mean is that the call to $this->initView() in the action's init() handles setting up the path to the view templates. </p>
<p>I don't see why you can't override it with a call to $this->view->setScriptPath() after the call to $this->initView() though.</p>
<p>Regards,</p>
<p>Rob&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis Soloshenko</title>
		<link>http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-8979</link>
		<dc:creator>Denis Soloshenko</dc:creator>
		<pubDate>Tue, 27 Mar 2007 21:58:43 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/03/25/questions-regarding-the-latest-tutorial-130/#comment-8979</guid>
		<description>Maybe my brain get tied of work, but I still can't find where you set path_to_templates in your tutorial?

"                                         It also sets up the Zend_View object to look in
views/scripts/{controller name} for the view scripts to be rendered
"

I've tried use: $this-&#62;view-&#62;setScriptPath('../user/templates');

But it didn't work.</description>
		<content:encoded><![CDATA[<p>Maybe my brain get tied of work, but I still can't find where you set path_to_templates in your tutorial?</p>
<p>"                                         It also sets up the Zend_View object to look in<br />
views/scripts/{controller name} for the view scripts to be rendered<br />
"</p>
<p>I've tried use: $this-&gt;view-&gt;setScriptPath('../user/templates');</p>
<p>But it didn't work.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
