<?php



namespace Website\Tool;



class AgencyNameForm extends \Zend_Form

{

    public $_agencyName;

    public $_submit;



    public function setAgencyNameLabel($param){

        if ($this->_agencyName instanceof \Zend_Form_Element) $this->_agencyName->setLabel($param);

    }



    public function setSubmitLabel($param){

        if ($this->_submit instanceof \Zend_Form_Element) $this->_submit->setLabel($param);

    }



    public function init(){



        $this->setMethod('post');



        $this->_agencyName = new \Zend_Form_Element_Text('agency_name');

        $this->_agencyName->setLabel('trad-agency-name');

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

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

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



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

        $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'))

        ));





        $this->_submit->setDecorators(array(

            'ViewHelper',

            'Errors',

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

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

        ));



    }

    

}