Yes it is, simply use the method as posted above:

$this->view->addHelperPath($defDir);

Then make $defDir the path to the directory holding your helpers. Or you can
do it in the bootstrap.

Simon


Mauricio Cuenca wrote:
> 
> Hellow Matthew,
> 
> Is it possible to have a common directory of helpers for the whole
> application, not specific ones for each module???
> 
> My application got bigger and I moved some controller to its own module
> and now the usual path (application/views/helpers) is not recognized.
> 
> 
> 
> Matthew Weier O'Phinney-3 wrote:
>> 
>> -- 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/
>> 
>> 
> 
> 


-----
Simon Corless

http://www.ajb007.co.uk/
-- 
View this message in context: 
http://www.nabble.com/use-helpers-in-modules-tp14251261s16154p15546900.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to