0
votes

I create simple form in 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');
        $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));
    }
}

My controller code is:

    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';
    }

and <?php echo $this->form; ?> When I render my form nothing happen, only white screen. When I render with this code in controller $this->view->form = 'test'; it show me "Test" text. What to do?

1
maybe $form = new Application_Form_User() ? ;) - opHASnoNAME
sorry, my mistake - without Application_... - GeorgeMore

1 Answers

2
votes

You've probably got error_reporting or display_errors turned off, so you won't see the fatal error when you try to instantiate Form_User, which should have been Application_Form_User.