How do I add a third party action helper to a Zend Framework 1.8+ application?

I have downloaded a third party action helper that I would like to add to my application. How can i do this?

0


a source to share


3 answers


Using the Noginn SendFile Action Helper as a link cataloged in the library, the directory structure looks like this:

/library
    /Noginn
        /Controller
            /Action
                /Helper
                    /SendFile.php

      

In /application/Bootstrap.php

add init function and add class prefix:



protected function _initActionHelpers()
{
    Zend_Controller_Action_HelperBroker::addPrefix('Noginn_Controller_Action_Helper');
}

      

Then, in your controller, you can call the action helper like this:

$this->_helper->sendFile($options);

      

+2


a source


This should help: Broker Assistant

Zend_Controller_Action_HelperBroker::addHelper(new Your_Controller_Action_Helper());

      



Just make sure it Your_Controller_Action_Helper

's auto-downloadable or enabled.

0


a source


Another solution is to add it directly like this:

Zend_Controller_Action_HelperBroker::addHelper(new Wow_Controller_Action_Helper_Auth());

      

You can also add a broker helper prefix like Andrew did, or add a path to your new helpers. All of these options are well explained by the guide .

0


a source







All Articles