我收到以下错误,不明白为什么:
Warning: Exception caught by form: Plugin by name 'TeamMember' was not found in the registry; used paths: Application_Decorator_: application/decorator/;decorator/
Zend_Form_Decorator_: Zend/Form/Decorator/
我从这里找到的文档工作:http: //framework.zend.com/manual/1.12/en/zend.form.decorators.html
在应用程序配置文件中定义了命名空间appnamespace = "Application"
装饰器文件放在application/decorators/TeamMember.php
类名是Application_Decorator_TeamMember
在施工期间,我有以下两行:
$element->addPrefixPath('Application_Decorator', 'application/decorators/', 'decorator');
$element->addDecorator('TeamMember');
在 viewScript 表单中,我有以下内容:
echo $this->element->teamMember->renderTeamMember() . "<br />";
echo $this->element->teamMember->render() . "<br />";
第一行生成错误,第二行将使用标签呈现元素,而不在标签末尾添加“:”。