Mar*_*tin 5 configuration zend-framework view-helpers
我正在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
Run Code Online (Sandbox Code Playgroud)
基本上我想访问currentUser.php中包含的视图助手,但是当我放入时
<?php echo $this->currentUser(); ?>
Run Code Online (Sandbox Code Playgroud)
我收到一条错误,指出无法找到该文件.
我需要添加到配置文件中以加载这些帮助程序?
我的配置是这样的......
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[] =
Run Code Online (Sandbox Code Playgroud)
我已经解决了...
我需要做的就是将此行添加到我的配置文件中:
user.resources.view.helperPath.Zend_View_Helper = APPLICATION_PATH "/modules/user/views/helpers"
Run Code Online (Sandbox Code Playgroud)