5

我正在 Zend Framework 中组合一个模块化应用程序,并且正在努力加载特定于模块的 View Helpers。

我的目录结构是这样的...

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

基本上我想访问 currentUser.php 中包含的视图助手但是当我把

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

我收到一条错误消息,指出找不到该文件。

我需要在配置文件中添加什么来加载这些帮助程序?

我的配置是这样的......

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

1 回答 1

4

我已经解决了...

我需要做的就是将此行添加到我的配置文件中:

user.resources.view.helperPath.Zend_View_Helper = APPLICATION_PATH "/modules/user/views/helpers"
于 2010-08-04T14:19:20.543 回答