public function getForm(array $companyTypes, array $statusList) { if (!$this->form) { $companyId = new Element\Hidden(); $companyId->setName('companyId'); $name = new Element\Text(); $name->setLabel('Name')->setName("name")->setAttribute('class', 'form-control'); $phone = new Element\Text(); $phone->setLabel('Phone')->setName("phone")->setAttribute('class', 'form-control'); $address = new Element\Textarea(); $address->setLabel('Address')->setName("address")->setAttribute('class', 'form-control'); $website = new Element\Url(); $website->setLabel('Website')->setName("website")->setAttribute('class', 'form-control'); $type = new Element\Select(); $type->setName("type")->setLabel('Type')->setAttribute('class', 'form-control')->setValueOptions($companyTypes); $status = new Element\Select(); $status->setName("status")->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($statusList); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($companyId); $form->add($name); $form->add($phone); $form->add($address); $form->add($website); $form->add($type); $form->add($status); $this->form = $form; } return $this->form; }
/** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function __construct($entityManager) { parent::__construct('contatoForm'); $this->setAttribute('method', 'post'); $this->setAttribute('id', 'fileupload'); $this->setEntityManager($entityManager); $idContato = new Element('idContato'); $idContato->setLabel('Contato'); $idContato->setAttributes(array('name' => 'idContato', 'id' => 'idContato', 'type' => 'hidden')); $this->add($idContato); $email = new Element('email'); $email->setLabel('Email'); $email->setAttributes(array('name' => 'email', 'id' => 'email', 'type' => 'text', 'class' => 'form-control')); $this->add($email); $assunto = new Element('assunto'); $assunto->setLabel('Assunto'); $assunto->setAttributes(array('name' => 'assunto', 'id' => 'assunto', 'type' => 'text', 'class' => 'form-control')); $this->add($assunto); $mensagem = new Element\Textarea('mensagem'); $mensagem->setLabel('Mensagem'); $mensagem->setAttributes(array('name' => 'mensagem', 'id' => 'mensagem', 'type' => 'textarea', 'class' => 'form-control')); $this->add($mensagem); $submit = new Element('submit'); $submit->setValue('Salvar'); $submit->setAttributes(array('type' => 'submit')); $this->add($submit); }
public function __construct($name = null) { parent::__construct($name); //id $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); //titolo $this->add(array('name' => 'titolo', 'options' => array('label' => 'Titolo'), 'attributes' => array('type' => 'text', 'class' => 'form-control'))); //contenuto $nota = new Element\Textarea('contenuto'); $nota->setLabel('Contenuto'); $nota->setAttribute('class', 'ckeditor form-control'); $this->add($nota); //Background $this->add(array('name' => 'background', 'attributes' => array('type' => 'Zend\\Form\\Element\\File'), 'options' => array('label' => 'Background'))); // Posterlab $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'posterlab', 'options' => array('label' => 'Posterlab', 'empty_option' => 'Scegli un posterlab =>'), 'attributes' => array('class' => 'form-control', 'onChange' => 'javascript:caricaPosizioni()', 'id' => 'posterlabs'))); // Posizione $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'posizione', 'options' => array('label' => 'posizione', 'empty_option' => 'Scegli una posizione =>', 'disable_inarray_validator' => true), 'attributes' => array('class' => 'form-control', 'id' => 'posizioni'))); // tipo $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'tipo', 'options' => array('label' => 'Tipo', 'empty_option' => 'Scegli tipo =>'), 'attributes' => array('class' => 'form-control'))); //stato $stato = new Element\Checkbox('stato'); $stato->setLabel('Stato'); $stato->setAttribute('class', 'make-switch'); $this->add($stato); $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => 'Salva', 'class' => 'btn green-haze pull-right'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Subject'); $group->setLabel('Thêm danh mục môn học'); $this->add($group); // name $name = new Text('name'); $name->setLabel('Tên danh mục:'); $name->setAttributes(['maxlength' => 255]); $this->add($name); $group->addElement($name); $filter->add(array('name' => 'name', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên danh mục')))))); // code $description = new Textarea('description'); $description->setLabel('Mô tả danh mục:'); $description->setAttributes(['maxlength' => 255, 'class' => 'form-control basicEditor ', 'style' => 'min-height: 300px;']); $this->add($description); $group->addElement($description); $filter->add(array('name' => 'description', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mô tả danh mục')))))); $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/admin/subject/addcategory'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/admin/subject/addcategory' => 'Tiếp tục nhập', '/admin/subject/category' => 'Hiện danh sách vừa nhập')))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
public function __construct() { parent::__construct('personorg'); $this->setAttribute('method', 'post'); $this->add(new Element\Hidden('id_person')); $this->add(new Element\Hidden('id_organization')); $this->add(new Element\Hidden('bool_primary')); $this->add(new Element\Hidden('nid_lov_personorgtype')); $this->add(new Element\Hidden('dt_begin')); $name_title = new Element\Text('name_title'); $name_title->setLabel('Title')->setAttributes(array('class' => 'largewhite')); $this->add($name_title); $pnum_primary_order = new Element\Select('num_primary_order'); $pnum_primary_order->setLabel('Primary Order')->setAttributes(array('class' => 'tinywhite')); $this->add($pnum_primary_order); $dt_end = new Element\Date('dt_end'); $dt_end->setLabel('End Date')->setAttributes(array('class' => 'smallwhite', 'type' => 'date', 'id' => 'dt_end'))->setOptions(array('datepickerOptions' => array('changeYear: true', 'changeMonth: true', 'yearRange: "c-100:c+100"'))); $this->add($dt_end); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'smallwhite')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn-success', 'style' => 'margin-right:70px;', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Login')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn-success', 'style' => 'margin: 10px 0 10px 140px')); $this->add($submit); }
public function prepareElements(array $categories) { $category = new Element\Select('category'); $category->setLabel('Category')->setOptions(array('options' => $categories)); $title = new Element\Text('title'); $title->setLabel('Title')->setAttribute('title', 'Enter a suitable title for this posting')->setAttribute('size', 40)->setAttribute('maxlength', 128); $priceMin = new Element\Text('priceMin'); $priceMin->setLabel('Minimum Price')->setAttribute('title', 'Enter mininum price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16); $priceMax = new Element\Text('priceMax'); $priceMax->setLabel('Maximum Price')->setAttribute('title', 'Enter maximum price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16); $expires = new Element\Date('expires'); $expires->setLabel('Expires')->setAttribute('title', 'The expiration date will be calculated from today')->setAttribute('size', 20)->setAttribute('maxlength', 20); $city = new Element\Text('city'); $city->setLabel('Nearest City')->setAttribute('title', 'Select the city of the item')->setAttribute('size', 40)->setAttribute('maxlength', 255); $country = new Element\Text('country'); $country->setLabel('Country Code')->setAttribute('title', 'Enter the 2 character ISO2 country code of the item')->setAttribute('size', 2)->setAttribute('maxlength', 2); $name = new Element\Text('name'); $name->setLabel('Contact Name')->setAttribute('title', 'Enter the name of the person to contact for this item')->setAttribute('size', 40)->setAttribute('maxlength', 255); $phone = new Element\Text('phone'); $phone->setLabel('Contact Phone Number')->setAttribute('title', 'Enter the phone number of the person to contact for this item')->setAttribute('size', 20)->setAttribute('maxlength', 32); $email = new Element\Email('email'); $email->setLabel('Contact Email')->setAttribute('title', 'Enter the email address of the person to contact for this item')->setAttribute('size', 40)->setAttribute('maxlength', 255); $description = new Element\Textarea('description'); $description->setLabel('Description')->setAttribute('title', 'Enter a suitable description for this posting')->setAttribute('rows', 4)->setAttribute('cols', 80); $submit = new Element\Submit('submit'); $submit->setAttribute('value', 'Search')->setAttribute('title', 'Click here when done'); $this->add($category)->add($title)->add($priceMin)->add($priceMax)->add($expires)->add($city)->add($country)->add($name)->add($phone)->add($email)->add($description)->add($submit); }
public function __construct() { parent::__construct('add'); $hydrator = new AggregateHydrator(); $hydrator->add(new PostHydrator()); $hydrator->add(new CategoryHydrator()); $this->setHydrator($hydrator); $title = new Element\Text('title'); $title->setLabel('Title'); $title->setAttribute('class', 'form-control'); $slug = new Element\Text('slug'); $slug->setLabel('Slug'); $slug->setAttribute('class', 'form-control'); $content = new Element\Textarea('content'); $content->setLabel('Content'); $content->setAttribute('class', 'form-control'); $category = new Element\Select('category_id'); $category->setLabel('Category'); $category->setAttribute('class', 'form-control'); $category->setValueOptions(array(1 => 'WIN', 2 => 'BUILD', 3 => 'SEND', 4 => 'GENERAL')); $submit = new Element\Submit('submit'); $submit->setValue('Add News'); $submit->setAttribute('class', 'btn btn-primary'); $this->add($title); $this->add($slug); $this->add($content); $this->add($category); $this->add($submit); }
public function __construct() { // we want to ignore the name passed parent::__construct('resp'); $this->setAttribute('method', 'post'); $name_resp = new Element\Text('name_resp'); $name_resp->setLabel('Responsibility')->setAttributes(array('class' => 'form-control input-sm')); $this->add($name_resp); $nid_lov_resptype = new Element\Select('nid_lov_resptype'); $nid_lov_resptype->setLabel('Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a type')); $this->add($nid_lov_resptype); $nid_timezone = new Element\Select('nid_timezone'); $nid_timezone->setLabel('Time Zone')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a timezone')); $this->add($nid_timezone); $id_locale = new Element\Select('nid_locale'); $id_locale->setLabel('Locale')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a locale')); $this->add($id_locale); $nid_language = new Element\Select('nid_language'); $nid_language->setLabel('Language')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a language')); $this->add($nid_language); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm')); $this->add($submit); }
public function __construct() { // we want to ignore the name passed parent::__construct('Attachment'); $this->add(new Element\Hidden('target_type_object')); $this->add(new Element\Hidden('target_id_row')); $this->setAttribute('method', 'post'); $nid_lov_attachmenttype = new Element\Select('nid_lov_attachmenttype'); $nid_lov_attachmenttype->setLabel('Attachment Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('' => 'Select a attachment type')); $this->add($nid_lov_attachmenttype); $url_or_filepath = new Element\Text('url_or_filepath'); $url_or_filepath->setLabel('Url or file path')->setAttributes(array('class' => 'form-control input-sm')); $this->add($url_or_filepath); $filename = new Element\Text('filename'); $filename->setLabel('File Name')->setAttributes(array('class' => 'form-control input-sm')); $this->add($filename); $filesize = new Element\Text('filesize'); $filesize->setLabel('File Size')->setAttributes(array('class' => 'form-control input-sm')); $this->add($filesize); $mimetype = new Element\Text('mimetype'); $mimetype->setLabel('Mime Type')->setAttributes(array('class' => 'form-control input-sm')); $this->add($mimetype); $bool_active = new Element\Radio('bool_active'); $bool_active->setLabel('Is Active?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite')); $this->add($bool_active); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm')); $this->add($submit); }
public function __construct(ObjectManager $objectManager) { $this->setObjectManager($objectManager); parent::__construct(null); $this->setAttribute('method', 'POST'); $this->setAttribute('class', 'form-horizontal'); //Input Titulo $titulo = new Text('titulo'); $titulo->setLabel('Titulo')->setAttributes(array('maxlength' => 80)); $this->add($titulo); //Input Descrição $descricao = new Textarea('descricao'); $descricao->setLabel('descriçao')->setAttributes(array('maxlength' => 150)); $this->add($descricao); //Input Titulo $texto = new Textarea('texto'); $texto->setLabel('Texto'); $this->add($texto); $ativo = new Checkbox('ativo'); $ativo->setLabel('Ativo'); $this->add($ativo); $categoria = new ObjectSelect('category'); $categoria->setLabel('Categoria')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => '\\Base\\Orm\\Entities\\Category', 'property' => 'nome', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('nome' => 'ASC'))))); $this->add($categoria); //Botao submit $button = new Button('submit'); $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn')); $this->add($button); $this->setInputFilter(new PostFilter($categoria->getValueOptions())); }
public function addElements() { $id = new Element\Text('id'); $id->setLabel('ID')->setAttribute('class', 'form-control')->setAttribute('type', 'hidden'); $this->add($id); $name = new Element\Text('name'); $name->setLabel('catalog name')->setAttribute('class', 'form-control')->setAttribute('required', 'true')->setAttribute('onchange', 'get_alias();')->setAttribute('id', 'name'); $this->add($name); $alias = new Element\Text('alias'); $alias->setLabel('catalog alias')->setAttribute('required', 'true')->setAttribute('class', 'form-control')->setAttribute('id', 'alias'); $this->add($alias); $description = new Element\Textarea('description'); $description->setLabel('Description')->setAttribute('class', 'materialize-textarea form-control')->setAttribute('id', 'description'); $this->add($description); $hot = new Element\Radio('hot'); $hot->setLabel('Choice hot')->setValueOptions(array('0' => 'No Hot', '1' => 'Hot'))->setAttribute('id', 'hot')->setAttribute('class', 'radio_style'); $this->add($hot); $new = new Element\Radio('new'); $new->setLabel('Choice new')->setValueOptions(array('0' => 'No New', '1' => 'New'))->setAttribute('id', 'new')->setAttribute('class', 'radio_style'); $this->add($new); $status = new Element\Radio('status'); $status->setLabel('status'); //->setAttribute('required', 'true') $status->setValueOptions(array('0' => 'Pause', '1' => 'Active'))->setAttribute('id', 'status')->setAttribute('class', 'radio_style'); $this->add($status); $show_index = new Element\Radio('show_index'); $show_index->setLabel('show_index'); //->setAttribute('required', 'true') $show_index->setValueOptions(array('0' => 'No', '1' => 'Yes'))->setAttribute('id', 'show_index')->setAttribute('class', 'radio_style'); $this->add($show_index); $img = new Element\File('img'); $img->setLabel('file img (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img'); $this->add($img); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('signin'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $this->setOptions(['layout' => 'fluid']); $filter = $this->getInputFilter(); //$groupBasic = new DisplayGroup('groupBasic'); //$this->add($groupBasic); $fullName = new Text('fullName'); $fullName->setLabel('Tên đầy đủ:'); $this->add($fullName); //$groupBasic->addElement($username); $filter->add(array('name' => 'fullName', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên')))))); $cityId = new Select('cityId'); $this->loadCities($cityId); $filter->add(array('name' => 'cityId', 'required' => false, 'filters' => array())); $this->add($cityId); $districtId = new Select('districtId'); $this->loadDistricts($districtId, $cityId, $options); $this->add($districtId); $filter->add(array('name' => 'districtId', 'required' => false, 'filters' => array())); $address = new Text('address'); $address->setLabel('Địa chỉ: '); $filter->add(array('name' => 'address', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập người dùng')))))); $this->add($address); // code $description = new Textarea('description'); $description->setLabel('Mô tả bản thân:'); $description->setAttributes(['class' => 'form-control basicEditor ', 'style' => 'min-height: 300px;']); $this->add($description); $filter->add(array('name' => 'description', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mô tả')))))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSignin', 'class' => 'btn btn btn-primary'))); //$groupBasic->addElement($this->get('submit')); }
/** * Add content element */ public function addContentElement($name = 'content') { $element = new Textarea($name); $element->setLabel('Beitragstext'); $element->setAttribute('class', 'ckeditor'); $this->add($element); }
public function buildForm() { $this->setAttribute('method', 'POST'); $category = new Select('category'); $category->setLabel('Category')->setValueOptions(array_combine($this->getCategories(), $this->getCategories())); $title = new Text('title'); $title->setLabel('Title')->setAttributes(array('size' => 50, 'maxLength' => 128, 'required' => 'required', 'placeholder' => 'Title', 'title' => 'Title')); $photo = new Text('photo_filename'); $photo->setLabel('Photo')->setAttribute('maxlength', 1024)->setAttribute('placeholder', 'Enter a valid image file URL'); $name = new Text('contact_name'); $name->setLabel('Contact Name')->setAttribute('title', 'Contact Name')->setAttribute('size', 50)->setAttribute('maxlength', 255); $email = new Email('contact_email'); $email->setLabel('Contact Email')->setAttribute('title', 'Contact Email')->setAttribute('size', 50)->setAttribute('maxlength', 255); $phone = new Text('contact_phone'); $phone->setLabel('Contact Phone Number')->setAttribute('title', 'Contact Phone Number')->setAttribute('size', 20)->setAttribute('maxlength', 32); $city = new Select('cityCode'); $city->setLabel('Nearest City')->setValueOptions(array_combine(self::$cityCodes, self::$cityCodes))->setAttribute('id', 'cityCode'); $price = new Text('price'); $price->setLabel('Price')->setAttribute('title', 'Price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16); $expires = new Radio('expires'); $expires->setLabel('Expires')->setAttribute('title', 'The expiration date from today')->setAttribute('class', 'expiresButton')->setValueOptions($this->getExpireDays()); $deleteCode = new Text('delete_code'); $deleteCode->setLabel('Delete Code')->setAttribute('title', 'Delete code for this item')->setAttribute('size', 16)->setAttribute('maxlength', 16); $description = new Textarea('description'); $description->setLabel('Description')->setAttribute('title', 'Description')->setAttribute('rows', 5)->setAttribute('cols', 80); $captchaAdapter = new ImageCaptcha(); $captchaAdapter->setWordlen(4)->setOptions($this->captchaOptions); $captcha = new Captcha('captcha'); $captcha->setCaptcha($captchaAdapter)->setLabel('Help us to prevent SPAM!')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Help us to prevent SPAM'); $submit = new Submit('submit'); $submit->setAttribute('value', 'Post'); $this->add($category)->add($title)->add($photo)->add($name)->add($email)->add($phone)->add($city)->add($price)->add($expires)->add($deleteCode)->add($description)->add($captcha)->add($submit); }
public function __construct() { parent::__construct('page'); //Méthode d'envoie (GET,POST) $this->setAttribute('method', 'post'); //Définition des champs //Menu Page // $idField = new Element\Select('menu_id'); // $idField->setAttribute('class', 'browser-default'); // $idField->setLabel('Menu'); // $this->add($idField); $idField = new Element\Hidden('structure'); $idField->setAttribute('id', 'structureform'); $this->add($idField); $idField = new Element\Hidden('block_element'); $idField->setAttribute('id', 'block-element'); $this->add($idField); //Page Category $idField = new Element\Select('ctgr_id'); $idField->setAttribute('class', 'browser-default'); $idField->setLabel('Category'); $this->add($idField); //Page Title $titleField = new Element\Text('title'); $titleField->setLabel('Titre'); $this->add($titleField); //Page Content $contentField = new Element\Textarea('content'); $contentField->setLabel('Description'); $this->add($contentField); $submitField = new Element\Submit('submit'); $submitField->setValue('Envoyer'); $submitField->setAttributes(array('id' => 'submitbutton', 'class' => 'btn waves-effect waves-light btn-submit-form-page')); $this->add($submitField); }
public function __construct($name = null) { parent::__construct($name); //id $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); //statosessione $this->add(array('name' => 'statosessione', 'attributes' => array('type' => 'hidden'))); //password visible $this->add(array('name' => 'password2', 'attributes' => array('type' => 'hidden'))); //titolo $this->add(array('name' => 'titolo', 'options' => array('label' => 'Titolo'), 'attributes' => array('type' => 'text', 'class' => 'form-control'))); //password $this->add(array('type' => 'Zend\\Form\\Element\\Password', 'name' => 'password', 'options' => array('label' => 'Password'), 'attributes' => array('class' => 'form-control'))); //confirmapassword $this->add(array('type' => 'Zend\\Form\\Element\\Password', 'name' => 'confirmarPassword', 'options' => array('label' => 'Confermare Password'), 'attributes' => array('class' => 'form-control'))); // Relatori $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'relatori', 'options' => array('label' => 'Relatori', 'empty_option' => 'Scegli un relatore =>'), 'attributes' => array('class' => 'form-control'))); // Steps $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'steps', 'options' => array('label' => 'Steps', 'empty_option' => 'Scegli steps =>'), 'attributes' => array('class' => 'form-control'))); //testo $nota = new Element\Textarea('nota'); $nota->setLabel('Nota'); $nota->setAttribute('class', 'ckeditor form-control'); $this->add($nota); //Durata $this->add(array('name' => 'durata', 'options' => array('label' => 'Durata Sessione'), 'attributes' => array('type' => 'text', 'class' => 'form-control'))); //Linkedin $this->add(array('name' => 'link', 'options' => array('label' => 'Link Report'), 'attributes' => array('type' => 'text', 'class' => 'form-control'))); //stato $stato = new Element\Checkbox('stato'); $stato->setLabel('Stato'); $stato->setAttribute('class', 'make-switch'); $this->add($stato); $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => 'Salva', 'class' => 'btn green-haze pull-right'))); }
public function __construct() { parent::__construct('form-cupom'); $nome = new Text('nome'); $nome->setLabel('Nome')->setAttributes(array('id' => 'nome', 'class' => 'form-control')); $this->add($nome); $codigo = new Text('codigo'); $codigo->setLabel('Código')->setAttributes(array('id' => 'codigo', 'class' => 'form-control')); $this->add($codigo); $descricao = new Textarea('descricao'); $descricao->setLabel('Descrição')->setAttributes(array('id' => 'descricao', 'class' => 'form-control')); $this->add($descricao); $tipo = new Select('tipo'); $tipo->setLabel('Tipo')->setAttributes(array('id' => 'tipo', 'class' => 'form-control', 'options' => array('1' => 'Cupom para o item', '2' => 'Cupom para o pedido'))); $this->add($tipo); $tipoDesconto = new Select('tipo_desconto'); $tipoDesconto->setLabel('Tipo Desconto')->setAttributes(array('id' => 'tipo_desconto', 'class' => 'form-control', 'options' => array('1' => 'Valor', '2' => 'Porcentagem'))); $this->add($tipoDesconto); $valor = new Text('valor'); $valor->setLabel('Valor')->setAttributes(array('id' => 'valor', 'class' => 'form-control')); $this->add($valor); $dtaIni = new Text('dta_ini'); $dtaIni->setLabel('Data Início')->setAttributes(array('id' => 'dta_ini', 'class' => 'form-control')); $this->add($dtaIni); $dtaFim = new Text('dta_fim'); $dtaFim->setLabel('Data Final')->setAttributes(array('id' => 'dta_fim', 'class' => 'form-control')); $this->add($dtaFim); }
public function __construct() { parent::__construct(null); $this->setInputFilter(new ReuniaoFilter()); $this->setAttribute('method', 'POST')->setAttribute('enctype', 'multipart/form-data'); $id = new \Zend\Form\Element\Hidden('id'); $this->add($id); $data = new Text('data'); $data->setLabel('Data')->setAttribute('autofocus', 'autofocus'); $this->add($data); $eventos = new Text('eventos'); $eventos->setLabel('Evento')->setAttribute('placeholder', 'Entre com o evento')->setAttribute('maxlength', 255)->setAttribute('size', 50); $this->add($eventos); $pauta = new Text('pauta'); $pauta->setLabel('Pauta')->setAttribute('maxlength', 255)->setAttribute('size', 50); $this->add($pauta); $cardapio = new Textarea('cardapio'); $cardapio->setLabel('Cardápio')->setAttribute('cols', '60')->setAttribute('rows', '5'); $this->add($cardapio); $listaPresente = new Textarea('lista_presente'); $listaPresente->setLabel('Lista de Presente')->setAttribute('cols', '60')->setAttribute('rows', '5'); $this->add($listaPresente); $ata = new Text('ata'); $ata->setLabel('Ata')->setAttribute('maxlength', 255)->setAttribute('size', 50); $this->add($ata); $imagnes = new File('imagens'); $imagnes->setLabel('Imagens')->setAttribute('id', 'imagnes'); $this->add($imagnes); $button = new Button('submit'); $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success')); $this->add($button); }
public function getForm(array $default_status) { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('userId'); $txtName = new Element\Text(); $txtName->setLabel('User Name')->setName("userName")->setAttribute('class', 'form-control'); $password = new Element\Password(); $password->setLabel('Password')->setName('password')->setAttribute('class', 'form-control'); $confirmPassword = new Element\Password(); $confirmPassword->setName('confirmPassword')->setLabel('Retype Password')->setAttribute('class', 'form-control'); $selectRole = new Element\Hidden('userRole'); $description = new Element\Textarea(); $description->setName('description')->setLabel('Description')->setAttribute('class', 'form-control'); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($default_status); $image = new Element\File(); $image->setName('image')->setLabel('Profile image'); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->setAttribute('enctype', 'multipart/form-data'); $form->add($hidId); $form->add($txtName); $form->add($password); $form->add($confirmPassword); $form->add($selectRole); $form->add($description); $form->add($status); $form->add($image); $this->form = $form; } return $this->form; }
public function getForm() { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('routeId'); $txtName = new Element\Text(); $txtName->setLabel('Route Name')->setName("name")->setAttribute('class', 'form-control'); $txtRoute = new Element\Text(); $txtRoute->setLabel('Route')->setName("route")->setAttribute('class', 'form-control'); $txtModule = new Element\Text(); $txtModule->setLabel("Module")->setName('module')->setAttribute('class', 'form-control'); $txtController = new Element\Text(); $txtController->setLabel("Controller")->setName('controller')->setAttribute('class', 'form-control'); $txtConstraints = new Element\Textarea(); $txtConstraints->setLabel("Constraints")->setName('constraints')->setAttribute('class', 'form-control'); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($hidId); $form->add($txtName); $form->add($txtRoute); $form->add($txtModule); $form->add($txtController); $form->add($txtConstraints); $this->form = $form; } return $this->form; }
public function __construct() { // we want to ignore the name passed parent::__construct('orgtype'); $this->setAttribute('method', 'post'); $type_organization = new Element\Text('type_organization'); $type_organization->setLabel('Organization Type')->setAttributes(array('class' => 'form-control input-sm')); $this->add($type_organization); $genre = new Element\Text('genre'); $genre->setLabel('Genre')->setAttributes(array('class' => 'form-control input-sm')); $this->add($genre); $bool_unioned = new Element\Radio('bool_unioned'); $bool_unioned->setLabel('Unioned ?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No')); $this->add($bool_unioned); $registered_location = new Element\Text('registered_location'); $registered_location->setLabel('Registered Location')->setAttributes(array('class' => 'form-control input-sm')); $this->add($registered_location); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm')); $this->add($submit); }
public function __construct(ServiceLocatorInterface $sm) { parent::__construct('formPost'); // definindo variáveis $em = $sm->get('Doctrine\\ORM\\EntityManager'); $arrCategorias = array("" => "Selecione"); $repoCategoria = $em->getRepository('Admin\\Entity\\Categoria'); $arrCategorias += $repoCategoria->fetchPairs(); $categoria = new Select('categoria'); $categoria->setLabel('Categoria')->setAttributes(array('id' => 'categoria', 'class' => 'form-control', 'options' => $arrCategorias)); $this->add($categoria); $nome = new Text('nome'); $nome->setLabel('Nome')->setAttributes(array('id' => 'nome', 'class' => 'form-control', 'placeholder' => 'Digite o seu nome')); $this->add($nome); $descricao = new Textarea('descricao'); $descricao->setLabel('Descrição')->setAttributes(array('id' => 'descricao', 'class' => 'form-control', 'style' => 'height: 80px', 'placeholder' => 'Digite a descrição do post')); $this->add($descricao); $conteudo = new Textarea('conteudo'); $conteudo->setLabel('Conteúdo')->setAttributes(array('id' => 'conteudo', 'class' => 'form-control', 'style' => 'min-height: 150px', 'placeholder' => 'Digite o conteúdo do post')); $this->add($conteudo); $tags = new Text('tags'); $tags->setLabel('Tags')->setAttributes(array('id' => 'tags', 'class' => 'form-control', 'placeholder' => 'Digite as tags do conteúdo')); $this->add($tags); $submit = new Submit('submit'); $submit->setValue('Salvar'); $this->add($submit); }
public function __construct(EntityManager $entityManager) { parent::__construct(); $this->entityManager = $entityManager; $this->setAttributes(array("method" => "post", "enctype" => "multipart/form-data", "class" => "form")); $this->setInputFilter(new FaqPerguntasFilters()); // Campo de titulo $titulo = new Text('titulo'); $titulo->setLabel("* Título")->setAttributes(array("maxLength" => "200", "class" => "form-control", "required" => "required")); // Campo de resposta $resposta = new Textarea('resposta'); $resposta->setLabel('* Resposta'); $resposta->setAttributes(array('class' => 'file form-control editor', 'cols' => '30', 'rows' => '10')); // Campo de titulo $tags = new Text('tags'); $tags->setLabel("* Tags")->setAttributes(array("maxLength" => "1000", "class" => "form-control count-character", "required" => "required")); // Campo categoria $categorias = new Select('id_categoria'); $categorias->setLabel("* Categoria")->setAttribute("class", "select")->setValueOptions($this->getCategorias()); // Botão de Submit $botao = new Submit("submit"); $botao->setAttributes(array("value" => "Salvar")); // Adiciona campos $this->add($titulo)->add($resposta)->add($tags)->add($categorias)->add($botao); }
/** * Add description element */ public function addDescriptionElement($name = 'description') { $element = new Textarea($name); $element->setLabel('Was hast du mit dem Rad vor? (optional - falls du das den anderen Nutzern mitteilen magst)'); $element->setAttribute('class', 'form-control'); $this->add($element); }
public function __construct() { // we want to ignore the name passed parent::__construct('communication'); $this->add(new Element\Hidden('id_party')); $this->add(new Element\Hidden('nid_commtype')); $this->add(new Element\Hidden('access_detail')); $this->add(new Element\Hidden('access_form')); $this->setAttribute('method', 'post'); $this->get('access_detail')->setLabel('Account / Number'); $num_primary_order = new Element\Text('num_primary_order'); $num_primary_order->setLabel('Number Primary Order')->setAttributes(array('class' => 'form-control input-sm')); $this->add($num_primary_order); $id_address = new Element\Select('id_address'); $id_address->setLabel('Address')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('' => 'No Address Binded')); $this->add($id_address); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm')); $this->add($submit); }
public function __construct(ServiceLocatorInterface $sl) { parent::__construct('form-produto'); // instanciando o entity manager do doctrine $em = $sl->get('Doctrine\\ORM\\EntityManager'); // definindo variáveis $arrCategorias = array('' => 'Selecione'); $repoCategorias = $em->getRepository('Admin\\Entity\\Categoria'); $arrCategorias += $repoCategorias->getCategorias(); $categoria = new Select('categoria'); $categoria->setLabel('Categoria do produto')->setAttributes(array('id' => 'categoria', 'class' => 'form-control', 'style' => 'width: 700px', 'options' => $arrCategorias)); $this->add($categoria); $codigo = new Text('codigo'); $codigo->setLabel('Código do produto')->setAttributes(array('id' => 'codigo', 'style' => 'width: 200px', 'class' => 'form-control')); $this->add($codigo); $nome = new Text('nome'); $nome->setLabel('Nome do produto')->setAttributes(array('id' => 'nome', 'style' => 'width: 700px', 'class' => 'form-control')); $this->add($nome); $slug = new Text('slug'); $slug->setLabel('Slug do produto')->setAttributes(array('id' => 'slug', 'style' => 'width: 700px', 'class' => 'form-control')); $this->add($slug); $descricao = new Textarea('descricao'); $descricao->setLabel('Descrição')->setAttributes(array('id' => 'descricao', 'style' => 'width: 700px; height: 100px', 'class' => 'form-control')); $this->add($descricao); $peso = new Text('peso'); $peso->setLabel('Peso')->setAttributes(array('id' => 'peso', 'style' => 'width: 150px', 'class' => 'form-control')); $this->add($peso); $ativo = new Checkbox('ativo'); $ativo->setLabel('Ativo')->setAttributes(array('id' => 'ativo', 'style' => 'width: 38px', 'class' => 'form-control')); $this->add($ativo); }
public function __construct($name = null, array $comissoes = null) { parent::__construct($name); $this->comissoes = $comissoes; $this->setInputFilter(new MembroFilter()); $this->setAttribute('method', 'POST'); $id = new Hidden('id'); $this->add($id); $comissao = new Select(); $comissao->setLabel("Comissão ")->setName("comissao")->setOptions(array('value_options' => $this->comissoes)); $this->add($comissao); $membro = new Textarea('membro'); $membro->setLabel('Membros')->setAttribute('placeholder', 'Entre com os membros')->setAttribute('cols', '60')->setAttribute('rows', '5')->setAttribute('autofocus', 'autofocus'); $this->add($membro); $cargo = new Textarea('cargo'); $cargo->setLabel('Cargos')->setAttribute('placeholder', 'Entre com os cargos')->setAttribute('cols', '60')->setAttribute('rows', '5'); $this->add($cargo); $dataInicio = new Text('data_inicio'); $dataInicio->setLabel('Data Inicio'); $this->add($dataInicio); $dataFim = new Text('data_fim'); $dataFim->setLabel('Data Fim'); $this->add($dataFim); $button = new Button('submit'); $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success')); $this->add($button); }
public function prepareElements($topicList, $categoryList, $captchaOptions) { // repurpose $topicList and $categoryList $topics = array('---' => 'Choose'); foreach ($topicList as $item) { $topics[$item->item] = $item->item; } $categories = array('---' => 'Choose'); foreach ($categoryList as $item) { $categories[$item->item] = $item->item; } $author = new Element\Hidden('author'); $category1 = new Element\Text('category'); $category1->setLabel('Category')->setAttribute('title', 'Enter a category: i.e. zf2 or use the dropdown list below')->setAttribute('size', 16)->setAttribute('maxlength', 16); $category2 = new Element\Select('selectCategory'); $category2->setValueOptions($categories); $topic1 = new Element\Text('topic'); $topic1->setLabel('Topic')->setAttribute('title', 'Enter a topic code: i.e. zf2f-2013-02-25 or use the dropdown list below')->setAttribute('size', 60)->setAttribute('maxlength', 254); $topic2 = new Element\Select('selectTopic'); $topic2->setValueOptions($topics); $title = new Element\Text('title'); $title->setLabel('Title')->setAttribute('title', 'Enter a suitable title for this posting')->setAttribute('size', 60)->setAttribute('maxlength', 254); $body = new Element\Textarea('body'); $body->setLabel('Body')->setAttribute('title', 'Enter the body for this posting')->setAttribute('rows', 4)->setAttribute('cols', 60); $captcha = new Element\Captcha('captcha'); $captchaAdapter = new Captcha\Image(); $captchaAdapter->setWordlen(4)->setOptions($captchaOptions); $captcha->setCaptcha($captchaAdapter)->setLabel('Help us to prevent SPAM!')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Help to prevent SPAM'); $submit = new Element\Submit('submit'); $submit->setAttribute('value', 'Post')->setAttribute('title', 'Click here when done'); $this->add($author)->add($topic1)->add($topic2)->add($category1)->add($category2)->add($title)->add($body)->add($captcha)->add($submit); }
public function __construct(ObjectManager $objectManager) { $this->setObjectManager($objectManager); parent::__construct(null); $this->setAttributes(array('method' => 'POST', 'accept-charset' => 'UTF-8', 'class' => 'form-horizontal')); //input Titulo $titulo = new Text('titulo'); $titulo->setLabel('Titulo')->setAttributes(array('id' => 'nome', 'maxlength' => 80, 'class' => 'form-control')); $this->add($titulo); //input descri��o $descricao = new Textarea('descricao'); $descricao->setLabel("Descricao")->setAttributes(array('id' => 'descricao', 'maxlength' => 150, 'class' => 'form-control')); $this->add($descricao); //input texto $texto = new Textarea('texto'); $texto->setLabel('Texto')->setAttributes(array('id' => 'texto', 'class' => 'form-control')); $this->add($texto); //input Ativo $ativo = new Checkbox('ativo'); $ativo->setLabel('Ativo')->setLabelAttributes(array('class' => 'checkbox-inline'))->setOptions(array('use_hidden_element' => true)); $this->add($ativo); //Categoria $categoria = new ObjectSelect('category'); $categoria->setLabel('Categoria')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Categoria\\Entity\\Category', 'property' => 'nome', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('nome' => 'ASC')))))->setAttributes(array('id' => 'category', 'class' => 'form-control')); $this->add($categoria); //botao submit $button = new Button('submit'); $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-default')); $this->add($button); $this->setInputFilter(new PostFilter($categoria->getValueOptions())); }
public function __construct() { // we want to ignore the name passed parent::__construct('timezone'); $this->setAttribute('method', 'post'); $name_timezone = new Element\Text('name_timezone'); $name_timezone->setLabel('Timezone')->setAttributes(array('class' => 'form-control input-sm')); $this->add($name_timezone); $num_timezone = new Element\Text('num_timezone'); $num_timezone->setLabel('Timezone Number')->setAttributes(array('class' => 'form-control input-sm')); $this->add($num_timezone); $bool_daylight_saving = new Element\Radio('bool_daylight_saving'); $bool_daylight_saving->setLabel('Daylight Saving')->setLabelAttributes(array('class' => 'checkbox-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No')); $this->add($bool_daylight_saving); $dt_summer_time_begin = new Element\Text('dt_summer_time_begin'); $dt_summer_time_begin->setLabel('Summer Time Begin')->setAttributes(array('type' => 'datetime', 'id' => 'dt_summer_time_begin', 'class' => 'form-control input-sm'))->setOptions(array('datepickerOptions' => array('autoSize: true'))); $this->add($dt_summer_time_begin); $dt_winter_time_begin = new Element\Text('dt_winter_time_begin'); $dt_winter_time_begin->setLabel('Winter Time Begin')->setAttributes(array('type' => 'datetime', 'id' => 'dt_winter_time_begin', 'class' => 'form-control input-sm'))->setOptions(array('datepickerOptions' => array('autoSize: true'))); $this->add($dt_winter_time_begin); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm')); $this->add($submit); }