我有一些在Zend Framework项目中使用自定义视图助手的自定义表单元素。它们在开发机器上加载并正常工作,但当我将项目移动到我的EC2服务器时,它们不会被加载。
来自application.ini:
resources.view.helperPath.Custom_View_Helper_ = APPLICATION_PATH "/../library/Custom/View/Helper/"
服务器返回错误:
Warning: Exception caught by form: Plugin by name 'Multiselect' was not found in the registry;
used paths:
Application_Views_Helpers_Fields_: /home/user/hippo/application/views/helpers/fields/
Application_Views_Helpers_: /home/user/hippo/application/views/helpers/
Custom_View_Helper_: /home/user/hippo/application/../library/Custom/View/Helper/
Zend_View_Helper_: Zend/View/Helper/:/home/user/hippo/application/views/helpers/ Stack
Trace:
#0 /home/user/hippo/library/Zend/View/Abstract.php(1182): Zend_Loader_PluginLoader->load('Multiselect')
#1 /home/user/hippo/library/Zend/View/Abstract.php(618): Zend_View_Abstract->_getPlugin('helper', 'multiselect')
#2 /home/user/hippo/library/Zend/Form/Decorator/ViewHelper.php(241): Zend_View_Abstract->getHelper('multiselect')
#3 /home/user/hippo/library/Zend/Form/Element.php(2043): Zend_Form_Decorator_ViewHelper->render('')
#4 /home/user/hippo/library/Zend/Form/Decorator/FormElements.php(111): Zend_Form_Element->render()
#5 /home/user/hippo/library/Zend/ in /home/user/hippo/library/Zend/Form.php on line 2925
什么可能导致这个在我的开发机器上工作但在EC2上没有?
答案 0 :(得分:0)
我弄明白了这个问题。我的开发机器是Mac,EC2运行Linux。我必须将public $helper='multiselect'
更改为public $helper='multiSelect'
,以便在搜索视图助手时搜索文件名MultiSelect.php
而不是Multiselect.php
。