1
我有這樣的簡化形式:Zend的形式 - 問題渲染單個元素
$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」有消息「視圖助手裝飾無法呈現沒有註冊的視圖對象」。
我在做什麼錯?我已經非常遵循此頁面上的Zend的文檔: http://framework.zend.com/manual/en/learning.form.decorators.individual.html
真誠, 爲什麼