我有一个具有以下操作的控制器:
public function addAction()
{
//action for the comments submission
$form = new Application_Form_Comment();
$form->submit->setLabel('Comment');
$this->view->form = $form;
if ($this->getRequest()->isPost()) {
$formData = $this->getRequest()->getPost();
if ($form->isValid($formData)) {
$comment = new Application_Model_DbTable_Comments();
$comment->addComment($formData['comment'], $id);
$this->_helper->redirector('index');
} else {
$form->populate($formData);
}
}
在我看来,如果我回显 $this->form; 表格不显示。
里克