作者:khinmyatky
项目:Office_Managemen
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;
}
作者:mauriciopibe
项目:sandbox-contac
/**
* @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);
}
作者:sebaxplac
项目:skilla-loca
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')));
}
作者:NguyenQuiDuon
项目:Funi
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')));
}
作者:shiqizhan
项目:php-sampl
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);
}
作者:lohmulle
项目:OnlineMarke
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);
}
作者:samij
项目:Deeplifec4t
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);
}
作者:shiqizhan
项目:php-sampl
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);
}
作者:shiqizhan
项目:php-sampl
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);
}
作者:eltondia
项目:vib
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()));
}
作者:gstearmi
项目:EshopVegeTabl
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);
}
作者:NguyenQuiDuon
项目:Funi
/**
* @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'));
}
作者:andreaszob
项目:softwar
/**
* Add content element
*/
public function addContentElement($name = 'content')
{
$element = new Textarea($name);
$element->setLabel('Beitragstext');
$element->setAttribute('class', 'ckeditor');
$this->add($element);
}
作者:saulotoled
项目:ZF2Cours
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);
}
作者:pinnack
项目:zend-projec
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);
}
作者:sebaxplac
项目:skilla-loca
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')));
}
作者:RodrigoAngeloValentin
项目:curso-zf
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);
}
作者:souzagab
项目:Agend
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);
}
作者:khinmyatky
项目:Office_Managemen
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;
}
作者:khinmyatky
项目:Office_Managemen
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;
}