public function __construct($name = null, $options = array()) { parent::__construct(isset($name) ? $name : 'personal'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $firstname_text = new Element\Text('firstname'); $firstname_text->setLabel('First name'); $firstname_text->setLabelAttributes(array('class' => 'type_text')); $firstname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...')); $lastname_text = new Element\Text('lastname'); $lastname_text->setLabel('Last name'); $lastname_text->setLabelAttributes(array('class' => 'type_text')); $lastname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => true)); $country_select = new Element\Select('country_id'); $country_select->setLabel('Country'); $country_select->setLabelAttributes(array('class' => 'select f_3_w50')); $country_select->setAttributes(array('class' => 'sel_chosen')); $country_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your country')); $state_select = new Element\Select('state_id'); $state_select->setLabel('Province/State'); $state_select->setLabelAttributes(array('class' => 'select f_3_w50')); $state_select->setAttributes(array('class' => 'sel_chosen', 'required' => true)); $state_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your state')); $city_select = new Element\Select('city_id'); $city_select->setLabel('City'); $city_select->setLabelAttributes(array('class' => 'select f_3_w50')); $city_select->setAttributes(array('class' => 'sel_chosen', 'required' => true)); $city_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your city')); $adress_text = new Element\Text('adress'); $adress_text->setLabel('Adress'); $adress_text->setLabelAttributes(array('class' => 'type_text')); $adress_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type adress in format (наш формат)')); $languages_select = new Element\Select('languages'); $languages_select->setLabel('Languages'); $languages_select->setLabelAttributes(array('class' => 'select', 'style' => 'float:left;')); $languages_select->setAttributes(array('class' => 'sel_chosen', 'multiple' => 'multiple', 'required' => true)); $languages_select->setOptions(array('disable_inarray_validator' => true)); $logo = new Element\Image('logo'); $logo->setAttributes(array('src', '/images/11.jpg', 'style' => 'float:left;')); $file = new Element\File('file'); $file->setLabelAttributes(array('style' => 'float:left;clear:both')); $this->add($id_hidden); $this->add($firstname_text); $this->add($lastname_text); $this->add($country_select); $this->add($state_select); $this->add($city_select); $this->add($adress_text); $this->add($languages_select); $this->add($logo); $this->add($file); }
public function addElements() { //-- File -- $file = new Element\File('file'); $file->setAttribute('placeholder', 'profile_name'); $file->setAttribute('required', 'true'); $file->setAttribute('class', 'form-control'); $file->setAttribute('id', 'file'); $file->setLabel('Profile name'); $file->setLabelAttributes(array('class' => 'control-label', 'for' => 'file')); //-- Submit -- $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn btn-success'); $submit->setValue('Send'); //-- Binding elements -- $this->add($file); $this->add($submit); }