Can't use my form

Posted by Alexandr on Stack Overflow See other posts from Stack Overflow or by Alexandr
Published on 2010-06-03T13:15:31Z Indexed on 2010/06/03 13:24 UTC
Read the original article Hit count: 260

Filed under:
|
|

I have class with my form in folder /application/forms/Auth.php it looks like

class Form_Auth extends Zend_Form
{
    public function __construct()
    {
        $this->setName();
        parent::__construct();

        $username = new Zend_Form_Element_Text('username');
        $password = new Zend_Form_Element_Password('password');
        $mail = new Zend_Form_Element_Text('mail');
        $submit = new Zend_Form_Element_Submit('submit');

        $this->addElements(array($username,$password,$mail,$submit));
    }
}

When i try create object

$this->view->form = new Form_Auth();

is see exeption

Application error

Exception information:

Message: Invalid name provided; must contain only valid variable characters and be non-empty

Stack trace:

D:\WWW\zends\application\Forms\Auth.php(8): Zend_Form->setName() d:\WWW\zends\application\controllers\RegistrationController.php(49): Form_Auth->__construct() D:\WebServer\ZendFramework\ZendFramework\library\Zend\Controller\Action.php(513): RegistrationController->indexAction() D:\WebServer\ZendFramework\ZendFramework\library\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('indexAction') D:\WebServer\ZendFramework\ZendFramework\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) D:\WebServer\ZendFramework\ZendFramework\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch() D:\WebServer\ZendFramework\ZendFramework\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() D:\WWW\zends\public\index.php(26): Zend_Application->run() {main} Request Parameters:

array ( 'controller' => 'registration', 'action' => 'index', 'module' => 'default', )

the version zf is 1.10.3

what i do wrong ?

© Stack Overflow or respective owner

Related posts about framework

Related posts about zend