<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Frustration with Zend Controller Action Helpers</title>
	<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Wed, 08 Sep 2010 13:03:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>

	<item>
		<title>By: Gummi</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-92</link>
		<author>Gummi</author>
		<pubDate>Mon, 10 Sep 2007 07:05:24 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-92</guid>
					<description>Just messing with same problem. Cannot load Action Controller anyhow - tried using addPath, addPrefix... :(</description>
		<content:encoded><![CDATA[<p>Just messing with same problem. Cannot load Action Controller anyhow - tried using addPath, addPrefix&#8230; <img src='http://www.oeic.net/oeic/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /></p>
]]></content:encoded>
				</item>
	<item>
		<title>By: steve</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-93</link>
		<author>steve</author>
		<pubDate>Mon, 10 Sep 2007 12:36:34 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-93</guid>
					<description>Gummi, what's the name of your helper class? It needs to have some string prefix that ends with an underscore. For example, if your class is currently named 'myControllerHelper', you have to rename it to '_myControllerHelper' or 'Gummi_myControllerHelper'. Then you could use addPath('/path/to/helper/files'), and it would work.

Take a look at line 116 of Zend/Controller/Action/HelperBroker.php in your framework library, and you'll see why you need this underscore.</description>
		<content:encoded><![CDATA[<p>Gummi, what&#8217;s the name of your helper class? It needs to have some string prefix that ends with an underscore. For example, if your class is currently named &#8216;myControllerHelper&#8217;, you have to rename it to &#8216;_myControllerHelper&#8217; or &#8216;Gummi_myControllerHelper&#8217;. Then you could use addPath(&#8217;/path/to/helper/files&#8217;), and it would work.</p>
<p>Take a look at line 116 of Zend/Controller/Action/HelperBroker.php in your framework library, and you&#8217;ll see why you need this underscore.</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: the rasx() context &#187; Blog Archive &#187; The Rumors Are True: I Am Rebuilding SonghaySystem.com on the Zend Framework</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-780</link>
		<author>the rasx() context &#187; Blog Archive &#187; The Rumors Are True: I Am Rebuilding SonghaySystem.com on the Zend Framework</author>
		<pubDate>Wed, 05 Mar 2008 20:05:53 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-780</guid>
					<description>[...] this guy “steve” who wrote “Frustration with Zend Controller Action Helpers,” I lost about nine hours trying to understand how Action Helpers work. View Helpers, on the [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] this guy “steve” who wrote “Frustration with Zend Controller Action Helpers,” I lost about nine hours trying to understand how Action Helpers work. View Helpers, on the [&#8230;]</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: jaly</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-2917</link>
		<author>jaly</author>
		<pubDate>Fri, 22 Aug 2008 23:35:35 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-2917</guid>
					<description>That's what brought here ,, action helper problem  
thanx for your notations</description>
		<content:encoded><![CDATA[<p>That&#8217;s what brought here ,, action helper problem<br />
thanx for your notations</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: T0aD</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-4411</link>
		<author>T0aD</author>
		<pubDate>Tue, 13 Jan 2009 17:49:35 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-4411</guid>
					<description>I've got the same problem, Im switching from CakePHP to Zend Framework for work, and I have to say Im really disappointed, it looks more like a bunch of libraries together than a ready-to-use framework so far.
ZF sucks balls !
And +1 for the really helpful exception message, thats completely retarded.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got the same problem, Im switching from CakePHP to Zend Framework for work, and I have to say Im really disappointed, it looks more like a bunch of libraries together than a ready-to-use framework so far.<br />
ZF sucks balls !<br />
And +1 for the really helpful exception message, thats completely retarded.</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Jason Gilmore</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-4483</link>
		<author>Jason Gilmore</author>
		<pubDate>Fri, 23 Jan 2009 17:07:18 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-4483</guid>
					<description>Hi guys,

Given the date of this post, I'd imagine Steve (the poster) resolved his problem long ago, however for others coming to this page in search of a solution I thought I'd offer some input in the hopes it will help. When defining an action helper you need to define both the path and the action helper class prefix within your bootstrap.php file, like so:

Zend_Controller_Action_HelperBroker::addPath( 'C:\apache\htdocs\website\application\My\Helper', 'My_Action_Helper');

Your action helper will subsequently look like this:

    class My_Action_Helper_InitializeStuff extends Zend_Controller_Action_Helper_Abstract
    {
       // Add methods here
   }

Once in place, your action helper should work like a charm.

Hope this helps!
Jason</description>
		<content:encoded><![CDATA[<p>Hi guys,</p>
<p>Given the date of this post, I&#8217;d imagine Steve (the poster) resolved his problem long ago, however for others coming to this page in search of a solution I thought I&#8217;d offer some input in the hopes it will help. When defining an action helper you need to define both the path and the action helper class prefix within your bootstrap.php file, like so:</p>
<p>Zend_Controller_Action_HelperBroker::addPath( &#8216;C:\apache\htdocs\website\application\My\Helper&#8217;, &#8216;My_Action_Helper&#8217;);</p>
<p>Your action helper will subsequently look like this:</p>
<p>    class My_Action_Helper_InitializeStuff extends Zend_Controller_Action_Helper_Abstract<br />
    {<br />
       // Add methods here<br />
   }</p>
<p>Once in place, your action helper should work like a charm.</p>
<p>Hope this helps!<br />
Jason</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: steve</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-4484</link>
		<author>steve</author>
		<pubDate>Fri, 23 Jan 2009 17:15:56 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-4484</guid>
					<description>Hi Jason, 
Thanks for posting some code that actually works as an addendum to my rant, as it seems that this page is getting a fair amount of hits these days.

Yeah, I figured out the issue, I was just complaining that ZF 1.0 requires a prefix for action helpers without making that requirement explict in the docs. In fact, I think it was obfuscated with the argument to set a prefix in the ::addPath() method. Not sure if this is still the case with ZF 1.7, but I should find out shortly, since I'm starting a new project with it now.</description>
		<content:encoded><![CDATA[<p>Hi Jason,<br />
Thanks for posting some code that actually works as an addendum to my rant, as it seems that this page is getting a fair amount of hits these days.</p>
<p>Yeah, I figured out the issue, I was just complaining that ZF 1.0 requires a prefix for action helpers without making that requirement explict in the docs. In fact, I think it was obfuscated with the argument to set a prefix in the ::addPath() method. Not sure if this is still the case with ZF 1.7, but I should find out shortly, since I&#8217;m starting a new project with it now.</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Love, Hate and Zend Framework &#171; Mcloide&#8217;s resources library</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-5842</link>
		<author>Love, Hate and Zend Framework &#171; Mcloide&#8217;s resources library</author>
		<pubDate>Tue, 09 Jun 2009 12:17:00 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-5842</guid>
					<description>[...] a friend of mine sent me this article &#8211; Frustration with Zend Controller Action Helpers &#8211; that only proves that Zend Framework, and I must say, one of the best frameworks I have [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] a friend of mine sent me this article &#8211; Frustration with Zend Controller Action Helpers &#8211; that only proves that Zend Framework, and I must say, one of the best frameworks I have [&#8230;]</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Shade</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-5843</link>
		<author>Shade</author>
		<pubDate>Tue, 09 Jun 2009 12:38:23 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-5843</guid>
					<description>In my case, this probably has a different cause, but that horribly unhelpful exception is still unchanged even in ZF 1.7.3. It quickly makes me go from "indifferent, I'm using this because my company demands it" to "I hate this [insert extremely powerful expletive here] and will never use it of my own volition".

The worst part is... it actually generates a somewhat more useful message, throws that as an exception and then ignores this, creating and throwing that useless and unhelpful "Action Helper by name xxx not found". I can think of many nasty things to do to the developer who came up with that. None of them fit for publication on a civilised blog.

Wasted 4 hours trying to fix this and counting.</description>
		<content:encoded><![CDATA[<p>In my case, this probably has a different cause, but that horribly unhelpful exception is still unchanged even in ZF 1.7.3. It quickly makes me go from &#8220;indifferent, I&#8217;m using this because my company demands it&#8221; to &#8220;I hate this [insert extremely powerful expletive here] and will never use it of my own volition&#8221;.</p>
<p>The worst part is&#8230; it actually generates a somewhat more useful message, throws that as an exception and then ignores this, creating and throwing that useless and unhelpful &#8220;Action Helper by name xxx not found&#8221;. I can think of many nasty things to do to the developer who came up with that. None of them fit for publication on a civilised blog.</p>
<p>Wasted 4 hours trying to fix this and counting.</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Djo</title>
		<link>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-6717</link>
		<author>Djo</author>
		<pubDate>Fri, 13 Nov 2009 00:29:49 +0000</pubDate>
		<guid>http://www.oeic.net/oeic/2007/07/27/frustration-with-zend-controller-action-helpers/#comment-6717</guid>
					<description>Yeah, the feedback was horrible but i make it work in few minutes... follow me!!!

First...
Create your helper file &lt;strong&gt;YourHelperFileName.php&lt;/strong&gt; and include it within the folder &lt;strong&gt;public_html\library\Zend\Controller\Action\Helper\&lt;/strong&gt; then name your class like this...
&lt;code&gt;class Zend_Controller_Action_Helper_SendFile extends Zend_Controller_Action_Helper_Abstract{}&lt;/code&gt;

Second...
open the &lt;strong&gt;bootstrap.php&lt;/strong&gt; file and write the next line inside your &lt;strong&gt;_initAutoload()&lt;/strong&gt; protected function.

&lt;code&gt;Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_YourHelperFileName());&lt;/code&gt;

Third...
Open your controller then code this line to memory it... then use it, and that's all! Use your new helper within 5 minutes.

&lt;code&gt;$this-&#62;_anyNameYouWant = $this-&#62;_helper-&#62;getHelper('YourHelperFileName');&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Yeah, the feedback was horrible but i make it work in few minutes&#8230; follow me!!!</p>
<p>First&#8230;<br />
Create your helper file <strong>YourHelperFileName.php</strong> and include it within the folder <strong>public_html\library\Zend\Controller\Action\Helper\</strong> then name your class like this&#8230;<br />
<code>class Zend_Controller_Action_Helper_SendFile extends Zend_Controller_Action_Helper_Abstract{}</code></p>
<p>Second&#8230;<br />
open the <strong>bootstrap.php</strong> file and write the next line inside your <strong>_initAutoload()</strong> protected function.</p>
<p><code>Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_YourHelperFileName());</code></p>
<p>Third&#8230;<br />
Open your controller then code this line to memory it&#8230; then use it, and that&#8217;s all! Use your new helper within 5 minutes.</p>
<p><code>$this-&gt;_anyNameYouWant = $this-&gt;_helper-&gt;getHelper('YourHelperFileName');</code></p>
]]></content:encoded>
				</item>
</channel>
</rss>
