Пример #1
0
 public function __construct($name = null)
 {
     parent::__construct('links');
     $weight_hidden = new Element\Hidden('weight');
     $title_text = new Element\Text('name');
     $title_text->setLabel('Title');
     $title_text->setLabelAttributes(array('class' => 'type_text'));
     $title_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => true));
     $url_text = new Element\Url('ref');
     $url_text->setLabel('Url');
     $url_text->setLabelAttributes(array('class' => 'type_text'));
     $url_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => true));
     $description_textarea = new Element\Textarea('description');
     $description_textarea->setLabel('Description');
     $description_textarea->setLabelAttributes(array('class' => 'type_text'));
     $description_textarea->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...'));
     $this->add($weight_hidden);
     $this->add($title_text);
     $this->add($url_text);
     $this->add($description_textarea);
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct('online');
     $this->setHydrator(new ArraySerializableHydrator(false));
     $adress_text = new Element\Url('url');
     $adress_text->setLabel('Url');
     $adress_text->setLabelAttributes(array('class' => 'type_text'));
     $adress_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type adress in format', 'required' => true));
     $this->add($adress_text);
     $this->add(array('type' => 'Button', 'name' => 'submit', 'options' => array('label' => 'delete'), 'attributes' => array('class' => 'btn btn btn_red3')));
 }