<?php



namespace Website\Tool;



class RegisterForm extends \Zend_Form

{

    public function setNameLabel($param){ $this->_name->setLabel($param); }

    public function setSurnameLabel($param){ $this->_surname->setLabel($param); }

    public function setEmailLabel($param){ $this->_email->setLabel($param); }

    public function setPasswordLabel($param){ $this->_password->setLabel($param); }

    public function setConfirmPasswordLabel($param){ $this->_confirmPassword->setLabel($param); }

    public function setSubmitLabel($param){ $this->_submit->setLabel($param); }





    public $_name;

    public $_surname;

    public $_email;

    public $_password;

    public $_confirmPassword;

    public $_submit;



    public function init()

    {

        $this->setMethod('post');



        $this->_name = new \Zend_Form_Element_Text('name');

        $this->_name->setLabel('trad-name');

        $this->_name->setRequired(true);

        $this->_name->setFilters(array('StringTrim'));

        $this->addElement($this->_name);



        $this->_surname = new \Zend_Form_Element_Text('surname');

        $this->_surname->setLabel('trad-surname');

        $this->_surname->setRequired(true);

        $this->_surname->setFilters(array('StringTrim'));

        $this->addElement($this->_surname);



        $this->_email = new \Zend_Form_Element_Text('email');

        $this->_email->setLabel('trad-email');

        $this->_email->setRequired(true);

        $this->_email->setFilters(array('StringTrim'));

        $this->addElement($this->_email);



        $this->_password = new \Zend_Form_Element_Password('password');

        $this->_password->setLabel('trad-password');

        $this->_password->setRequired(true);

        $this->addElement($this->_password);



        $this->_confirmPassword = new \Zend_Form_Element_Password('confirm_password');

        $this->_confirmPassword->setLabel('trad-pwd-confirmation');

        $this->_confirmPassword->setRequired(true);

        $this->_confirmPassword->addValidator('Identical', false, array('token' => 'password'));

        $this->addElement($this->_confirmPassword);





        $this->_submit = new \Zend_Form_Element_Submit('submit');

        $this->_submit->setIgnore(true);

        $this->_submit->setLabel('trad-submit');

        $this->addElement($this->_submit);





        $this->setDecorators(array(

            'FormElements',

            array('HtmlTag', array('tag' => 'div')),

            'Form'

        ));



        $this->setElementDecorators(array(

            'ViewHelper',

            'Errors',

            array(array('data' => 'HtmlTag'), array('tag' => 'span')),

            array('Label', array('tag' => 'span')),

            array(array('row' => 'HtmlTag'), array('tag' => 'div'))

        ));





    }

}