views:

36

answers:

1

Hello everyone! 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?

+2  A: 

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.

Daniel Egeberg
errors are on in index file error_reporting(E_ALL|E_STRICT);ini_set('display_errors', 'on');
George
what are the settings in application.ini? Bootstrapping can will overrule things you set in index.php
timdev
it's standart settings after creating new project
George