views:

141

answers:

1

Hi,

I am putting together a modular application in Zend Framework and am struggling to get module specific View Helpers to load.

My directory structure is like this...

application
---configs  
---controllers  
---forms  
---layouts  
---models  
---modules  
------user  
---------controllers  
---------forms  
---------modules  
---------views  
------------filters
------------helpers  
---------------currentUser.php  
------------scripts  
---------Bootstrap.php  
---views  
---Bootstrap.php  

basically I want to access the view helper that is contained in currentUser.php but when I put

<?php echo $this->currentUser(); ?>  

I get an error stating that the file cannot be found.

What do I need to add to my config file to load these helpers?

My config is something like this...

Autoloadernamespaces[] = "Zend_"
Autoloadernamespaces[] = "Default_"
Autoloadernamespaces[] = "User_"

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

includePaths.library = APPLICATION_PATH "/../library"

bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"

resources.frontController.controllerDirectory = APPLICATION_PATH    "/controllers"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"

resources.view[] =
resources.modules[] = 
A: 

I have worked it out...

All I need to do was to add this line to my config file:

user.resources.view.helperPath.Zend_View_Helper = APPLICATION_PATH "/modules/user/views/helpers"
Martin