Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-09-2008, 12:09 PM
Junior Member
 
Join Date: May 2008
Posts: 1
Default Share view helpers across different modules

Hi,

I have multiple modules for different parts of my site. I have a directory structure like this:

/application/controllers (controllers of the default module)
/application/views/helpers/
/application/views/scripts/ (view scripts for the default module)
/application/models (models for the whole application)
/application/layouts
/application/members/controllers (controllers for the members module)
/application/members/views/scripts/ (view scripts for the members module)

I'd like to share the view helpers and the models across all my modules, because I need them for every module. Is there an easy way to that, or is the only option to call in every controller addHelperPath?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-09-2008, 08:55 PM
Junior Member
 
Join Date: Oct 2007
Posts: 27
Default

I'm fairly sure that the location of the helpers doesn't matter, because any helper with your prefix is loaded from the path and the module is not taken into consideration.

PHP Code:
$viewRenderer Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');

$viewRenderer->initView();

$viewRenderer->setViewSuffix('php');

//include our custom helpers
$viewRenderer->view->addHelperPath(APPLICATION_DIRECTORY '/views/helpers''My_View_Helper'); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:08 PM.