title: Zend Framework call view helper from a Zend_View_Helper
body: <p>I have a helper called <code>Zend_View_Helper_FormVars</code> that's used by one of my modules.
  I also have a common helper in <code>application/common/helpers/GeneralFunctions.php</code></p>
  
  <p>I'm trying to call a function from <code>Zend_View_Helper_FormVars</code> that's in  <code>GeneralFunctions.php</code>.</p>
  
  <p>Here is the short version of <code>Zend_View_Helper_FormVars</code>:</p>
  
  <pre><code>class Zend_View_Helper_FormVars
  {
      public $reqFieldVisual='&lt;span class="req"&gt;*&lt;/span&gt;';
      public $roles=array('admin'=&gt;'admin', 'user'=&gt;'user');
      public $paymentMethods=array('1'=&gt;'Check', '2'=&gt;'Credit Card',
                  '3'=&gt;'Cash', '4'=&gt;'Other');
  
  
      public function formVars(){
          $this-&gt;baseUrl=Zend_Controller_Front::getInstance()-&gt;getBaseUrl();
          return $this;
      }
  
      public function mkCategoryCodeSelectGroup($codeTypeArr=array(),
          $codesArr=array()) {
          $html='';
          $html.=Zend_View_Helper_GeneralFunctions::generalFunctions()-&gt;progressMeter();
          return $html;
      }
  }
  </code></pre>
  
  <p>Here is the code in <code>GeneralFunctions.php</code>:</p>
  
  <pre><code>class Zend_View_Helper_GeneralFunctions
  {
      public function generalFunctions(){
          $this-&gt;baseUrl=Zend_Controller_Front::getInstance()-&gt;getBaseUrl();
          return $this;   
      }
  
      public function progressMeter() {
          $html='';
          $html.='&lt;span id="progressWrapper"&gt;';
          $html.='&lt;span id="progressMeter"&gt;&lt;/span&gt;';
          $html.='&lt;/span&gt;';
          $html.='';
          return $html;
      }
  }
  </code></pre>
  
  <p>Also, forgot to mention that I have the <code>GeneralFunctions</code> helper auto loaded in the Bootstrap like this and it's available to all my modules already:</p>
  
  <pre><code>$view-&gt;addHelperPath(APPLICATION_PATH .'/common/helpers', 'View_Helper');
  </code></pre>
  
  <hr>
  
  <p>Here is what I tried, but am getting an error:</p>
  
  <pre><code>// application/Bootstrap.php -----------&gt;
  function _initViewHelpers() {
      // add a helper for use for all modules
      $view-&gt;addHelperPath(APPLICATION_PATH .'/Common/Helper', 'Common_Helper');
  }
  //--------------------&gt;
  
  
  // application/common/helpers/General.php -----------&gt;
  class Zend_View_Helper_General extends Zend_View_Helper_Abstract
  {
      public function general(){
          return $this;
      }   
      public function test(){
          return 'test 123';
      }
  }
  //--------------------&gt;
  
  // application/modules/dashboard/views/helpers/DashboardHelper.php -----------&gt;
  class Zend_View_Helper_DashboardHelper extends Common_Helper_General
  {
  
      public function dashboardHelper(){
          return $this;
      }
  
      public function dashboardTest(){
          return 'from dashboard';
      }
  
  }
  //--------------------&gt;
  
  // application/modules/dashboard/views/scripts/index/index.phtml -----------&gt;
  echo $this-&gt;dashboardHelper()-&gt;test();
  //--------------------&gt;
  </code></pre>
  
  <p>Error message I get:</p>
  
  <blockquote>
    <p>Fatal error: Class 'Common_Helper_General' not found in /Applications/MAMP/htdocs/mysite/application/modules/dashboard/views/helpers/DashboardHelper.php on line 2</p>
  </blockquote>