当前位置: 首页>>代码示例>>PHP>>正文


PHP Element\Textarea类代码示例

本文整理汇总了PHP中Zend\Form\Element\Textarea的典型用法代码示例。如果您正苦于以下问题:PHP Textarea类的具体用法?PHP Textarea怎么用?PHP Textarea使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Textarea类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getForm

 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;
 }
开发者ID:khinmyatkyi,项目名称:Office_Management,代码行数:30,代码来源:CompanyHelper.php

示例2: __construct

 /**
  * @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);
 }
开发者ID:mauriciopiber,项目名称:sandbox-contact,代码行数:30,代码来源:ContatoForm.php

示例3: __construct

 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')));
 }
开发者ID:sebaxplace,项目名称:skilla-local,代码行数:27,代码来源:Content.php

示例4: __construct

 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')));
 }
开发者ID:NguyenQuiDuong,项目名称:Funix,代码行数:26,代码来源:Category.php

示例5: __construct

 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);
 }
开发者ID:shiqizhang,项目名称:php-sample,代码行数:28,代码来源:PersonOrgForm.php

示例6: prepareElements

 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);
 }
开发者ID:lohmuller,项目名称:OnlineMarket,代码行数:28,代码来源:SearchForm.php

示例7: __construct

 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);
 }
开发者ID:samija,项目名称:Deeplifec4tk,代码行数:29,代码来源:Add.php

示例8: __construct

 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);
 }
开发者ID:shiqizhang,项目名称:php-sample,代码行数:30,代码来源:RespForm.php

示例9: __construct

 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);
 }
开发者ID:shiqizhang,项目名称:php-sample,代码行数:35,代码来源:AttachmentForm.php

示例10: __construct

 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()));
 }
开发者ID:eltondias,项目名称:vibe,代码行数:30,代码来源:PostForm.php

示例11: addElements

 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);
 }
开发者ID:gstearmit,项目名称:EshopVegeTable,代码行数:34,代码来源:CatalogForm.php

示例12: __construct

 /**
  * @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'));
 }
开发者ID:NguyenQuiDuong,项目名称:Funix,代码行数:38,代码来源:EditProfile.php

示例13: addContentElement

 /**
  * Add content element
  */
 public function addContentElement($name = 'content')
 {
     $element = new Textarea($name);
     $element->setLabel('Beitragstext');
     $element->setAttribute('class', 'ckeditor');
     $this->add($element);
 }
开发者ID:andreaszobl,项目名称:software,代码行数:10,代码来源:BlogForm.php

示例14: buildForm

 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);
 }
开发者ID:saulotoledo,项目名称:ZF2Course,代码行数:33,代码来源:PostForm.php

示例15: __construct

 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);
 }
开发者ID:pinnackl,项目名称:zend-project,代码行数:35,代码来源:PageForm.php


注:本文中的Zend\Form\Element\Textarea类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。