Php 渲染Zend_表单(白屏)
我在forms/user.php中创建简单表单:Php 渲染Zend_表单(白屏),php,zend-framework,zend-form,Php,Zend Framework,Zend Form,我在forms/user.php中创建简单表单: class Form_User extends Zend_Form { public function __construct() { parent::__construct(); $this->setName('form_user'); $username = new Zend_Form_Element_Text('username'); $passwo
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';
}
和
当我渲染我的窗体时,什么也没有发生,只有白色屏幕。
当我在controller
$this->view->form='test'中使用此代码进行渲染时代码>显示“测试”文本。怎么办?您可能已经关闭了错误报告
或显示错误
,因此当您尝试实例化表单用户
时,您将不会看到致命错误,这应该是应用程序表单用户
可能$Form=新应用程序表单用户()抱歉,我的错误-没有应用程序…索引文件错误报告中出现错误(E|u ALL | E|u STRICT);ini_设置(“显示错误”、“打开”);application.ini中的设置是什么?在创建新项目后,引导将否决您在index.phpit的标准设置中设置的内容