5

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[] = 

1 Answer 1

4

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"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.