Note that there are some explanatory texts on larger screens.

plurals
  1. POZend framework Zend_Controller_Action_HelperBroker::addPath does not work
    primarykey
    data
    text
    <p>I get this message regardless of the path used and even if I place the class file in the default directory location. </p> <pre><code>Zend_Controller_Action_HelperBroker::addPath('./Plugins/Helpers','Helper'); Sorry, An error has occured: Application Error:exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'FormLoader' was not found in the registry; used paths: Zend_Controller_Action_Helper_: Zend/Controller/Action/Helper/' in C:\PHP\Zendframework\Zend\Loader\PluginLoader.php:412 Stack trace: #0 C:\PHP\Zendframework\Zend\Controller\Action\HelperBroker.php(366): Zend_Loader_PluginLoader-&gt;load('FormLoader') #1 C:\PHP\Zendframework\Zend\Controller\Action\HelperBroker.php(293): Zend_Controller_Action_HelperBroker::_loadHelper('FormLoader') #2 C:\PHP\Zendframework\Zend\Controller\Action\HelperBroker.php(323): Zend_Controller_Action_HelperBroker-&gt;getHelper('formLoader') #3 D:\websites\maklare.easypic.se\appfiles\application\controllers\UserController.php(13): Zend_Controller_Action_HelperBroker-&gt;__call('formLoader', Array) #4 D:\websites\maklare.easypic.se\appfiles\application\controllers\UserController.php(13): Zend_Controller_Action_HelperBroker-&gt;formLoader('login') #5 C:\PHP\Zendframework\Zend\Controller\Action.php(513): UserController-&gt;indexAction() #6 C:\PHP\Zendframework\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action-&gt;dispatch('indexAction') #7 C:\PHP\Zendframework\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard-&gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #8 C:\PHP\Zendframework\Zend\Controller\Front.php(212): Zend_Controller_Front-&gt;dispatch() #9 D:\websites\maklare.easypic.se\index.php(23): Zend_Controller_Front::run('D:\websites\mak...') #10 {main} Next exception 'Zend_Controller_Action_Exception' with message 'Action Helper by name FormLoader not found' in C:\PHP\Zendframework\Zend\Controller\Action\HelperBroker.php:369 Stack trace: #0 C:\PHP\Zendframework\Zend\Controller\Action\HelperBroker.php(293): Zend_Controller_Action_HelperBroker::_loadHelper('FormLoader') #1 C:\PHP\Zendframework\Zend\Controller\Action\HelperBroker.php(323): Zend_Controller_Action_HelperBroker-&gt;getHelper('formLoader') #2 D:\websites\maklare.easypic.se\appfiles\application\controllers\UserController.php(13): Zend_Controller_Action_HelperBroker-&gt;__call('formLoader', Array) #3 D:\websites\maklare.easypic.se\appfiles\application\controllers\UserController.php(13): Zend_Controller_Action_HelperBroker-&gt;formLoader('login') #4 C:\PHP\Zendframework\Zend\Controller\Action.php(513): UserController-&gt;indexAction() #5 C:\PHP\Zendframework\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action-&gt;dispatch('indexAction') #6 C:\PHP\Zendframework\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard-&gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #7 C:\PHP\Zendframework\Zend\Controller\Front.php(212): Zend_Controller_Front-&gt;dispatch() #8 D:\websites\maklare.easypic.se\index.php(23): Zend_Controller_Front::run('D:\websites\mak...') #9 {main} </code></pre> <p>The loader code:</p> <pre><code>&lt;?php /** * Action Helper for loading forms * * @uses Zend_Controller_Action_Helper_Abstract */ class My_Helper_FormLoader extends Zend_Controller_Action_Helper_Abstract { /** * @var Zend_Loader_PluginLoader */ public $pluginLoader; /** * Constructor: initialize plugin loader * * @return void */ public function __construct() { $this-&gt;pluginLoader = new Zend_Loader_PluginLoader(); } /** * Load a form with the provided options * * @param string $name * @param array|Zend_Config $options * @return Zend_Form */ public function loadForm($name, $options = null) { $module = $this-&gt;getRequest()-&gt;getModuleName(); $front = $this-&gt;getFrontController(); $default = $front-&gt;getDispatcher() -&gt;getDefaultModule(); if (empty($module)) { $module = $default; } $moduleDirectory = $front-&gt;getControllerDirectory($module); $formsDirectory = dirname($moduleDirectory) . '/forms'; $prefix = (('default' == $module) ? '' : ucfirst($module) . '_') . 'Form_'; $this-&gt;pluginLoader-&gt;addPrefixPath($prefix, $formsDirectory); $name = ucfirst((string) $name); $formClass = $this-&gt;pluginLoader-&gt;load($name); return new $formClass($options); } /** * Strategy pattern: call helper as broker method * * @param string $name * @param array|Zend_Config $options * @return Zend_Form */ public function direct($name, $options = null) { return $this-&gt;loadForm($name, $options); } } ?&gt; </code></pre> <p>The bootstrap;</p> <pre><code>&lt;?php require 'appfiles\helpers\fb_sdk\src\facebook.php'; #------------------------------ # Get the paths set #------------------------------ define('ROOT', realpath(dirname(__FILE__) . '/appfiles')); #------------------------------ # Register the Zend autolaoder #------------------------------ require_once ('Zend\Loader\Autoloader.php'); Zend_Loader_Autoloader::getInstance(); #------------------------------ # Dispatch #------------------------------ require_once('appfiles\functions\functions.php'); Zend_Controller_Front::run( ROOT . '/application/controllers' ); Zend_Controller_Action_HelperBroker::addPath( ROOT .'/helpers'); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload