【发布时间】:2011-08-21 01:16:04
【问题描述】:
我有这个简化的形式:
$this->form = new \Zend_Form();
$this->form->setAction($request->currentPath());
$this->form->setMethod('post');
$this->form->addElement('text', 'firstName', array(
'label' => 'First name: ',
));
我想在我的视图页面中单独呈现元素。像这样:
<?php echo $form->firstName->renderViewHelper() ?>
但我不断收到此错误:
致命错误: 未捕获的异常“Zend_Form_Decorator_Exception”与消息“ViewHelper 装饰器无法在没有注册的视图对象的情况下呈现”。
我做错了什么?我非常关注此页面上的 Zend 文档: http://framework.zend.com/manual/en/learning.form.decorators.individual.html
真诚地, 为什么
【问题讨论】:
标签: php zend-framework zend-form