-- ashish.sharma <[EMAIL PROTECTED]> wrote
(on Monday, 10 December 2007, 03:34 AM -0800):
> i have a query regarding helpers,i have helpers in my default module helpers
> folder i:e(in application/views/helpers/generateKey.php) now i have created
> new module and i want to use that helper in this module.how can i do this
> ,plz help me as its very urgent.

Short answer:

    // within your action controller:
    $conDirs = Zend_Controller_Front::getInstance()->getControllerDirectory();
    $defDir  = dirname($conDirs['default']) . '/views/helpers';
    $this->view->addHelperPath($defDir);

Long answer:

You grab the controller directory associated with the module you wish to
use, determine the views directory associated with it, and add its
helpers subdirectory as a helper path on the view object.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to