我創建的形式簡單的形式/ user.php的:渲染Zend_Form的(白色屏幕)
class Form_User extends Zend_Form
{
public function __construct() {
parent::__construct();
$this->setName('form_user');
$username = new Zend_Form_Element_Text('username');
$password = new Zend_Form_Element_Password('password');
$email = new Zend_Form_Element_Text('email');
$submit = new Zend_Form_Element_Submit('submit');
$this->addElements(array($username, $password, $email, $submit));
}
}
我的控制器代碼是:
public function registrationAction()
{
$this->view->title = 'Reg new acc!';
$this->view->headTitle($this->view->title, 'PREPEND');
$form = new Form_User();
$this->view->form = $form;
// $this->view->form = 'test';
}
和<?php echo $this->form; ?>
當我使我的形式沒有發生,只有白色的屏幕。 當我在控制器$this->view->form = 'test';
中使用此代碼進行渲染時,它會顯示「測試」文本。該怎麼辦?
maybe $ form = new Application_Form_User()? ;) – opHASnoNAME 2010-07-02 11:37:27
對不起,我的錯誤 - 沒有應用程序_... – GeorgeMore 2010-07-02 11:43:12