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


PHP Textarea::setAttributes方法代码示例

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


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

示例1: __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

示例2: __construct

 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);
 }
开发者ID:kayo-almeida,项目名称:cms-zend,代码行数:25,代码来源:FaqPerguntasForm.php

示例3: __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

示例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: getForm

 /**
  * Get the HTML editor textarea markup.
  *
  * @param PhpRenderer $view
  * @param string $id HTML ID for the textarea
  * @param string $value Value to pre-fill
  *
  * @return string
  */
 protected function getForm(PhpRenderer $view, $id, $value = '')
 {
     $view->ckEditor();
     $textarea = new Textarea('o:media[__index__][html]');
     $textarea->setOptions(['label' => $view->translate('HTML'), 'info' => $view->translate('HTML or plain text.')]);
     $textarea->setAttributes(['rows' => 15, 'id' => $id, 'required' => true, 'class' => 'media-html', 'value' => $value]);
     $field = $view->formRow($textarea);
     $field .= "\n            <script type='text/javascript'>\n                \$('#{$id}').ckeditor();\n            </script>\n        ";
     return $field;
 }
开发者ID:patrova,项目名称:omeka-s,代码行数:19,代码来源:Html.php

示例6: __construct

 public function __construct($name = null)
 {
     parent::__construct('page');
     $id_hidden = new Element\Hidden('id');
     $id_hidden->setName('id');
     $title_text = new Element\Text('title');
     $title_text->setLabel('Title');
     $title_text->setLabelAttributes(array('class' => 'type_text type_text_short'));
     $title_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require'));
     $url_text = new Element\Text('url');
     $url_text->setLabel('Url');
     $url_text->setLabelAttributes(array('class' => 'type_text type_text_short'));
     $url_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require'));
     $text_textarea = new Element\Textarea('text');
     $text_textarea->setLabel('Text');
     $text_textarea->setLabelAttributes(array('class' => 'type_text'));
     $text_textarea->setAttributes(array('placeholder' => 'Type something...'));
     $auto_check = new Element\Checkbox('auto');
     $auto_check->setLabel('Automatically');
     $auto_check->setLabelAttributes(array('class' => 'type_text type_check'));
     $auto_check->setUseHiddenElement(true);
     $auto_check->setCheckedValue("1");
     $auto_check->setUncheckedValue("0");
     $auto_check->setValue('1');
     $meta_text = new Element\Text('meta');
     $meta_text->setLabel('Meta');
     $meta_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker'));
     $meta_text->setAttributes(array('class' => 'type_text_input'));
     $keywords_text = new Element\Text('keywords');
     $keywords_text->setLabel('Keywords');
     $keywords_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker'));
     $keywords_text->setAttributes(array('class' => 'type_text_input'));
     $desc_text = new Element\Text('description');
     $desc_text->setLabel('Description');
     $desc_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker'));
     $desc_text->setAttributes(array('class' => 'type_text_input'));
     $submit_button = new Element\Submit('submit');
     $submit_button->setValue('Submit');
     $submit_button->setAttributes(array('class' => 'btn btn_white'));
     $cancel_button = new Element\Submit('cancel');
     $cancel_button->setValue('Cancel');
     $cancel_button->setAttributes(array('class' => 'btn btn_rozy'));
     $this->add($id_hidden);
     $this->add($title_text);
     $this->add($url_text);
     $this->add($text_textarea);
     $this->add($auto_check);
     $this->add($meta_text);
     $this->add($keywords_text);
     $this->add($desc_text);
     $this->add($submit_button);
     $this->add($cancel_button);
 }
开发者ID:KukaBazuka,项目名称:zendy,代码行数:53,代码来源:PageForm.php

示例7: addElements

 public function addElements()
 {
     $this->setAttribute('method', 'post');
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $element = new Element\Text('title');
     $element->setAttributes(array('class' => 'username', 'size' => '30', 'class' => 'form-control', 'placeholder' => 'title'));
     $this->add($element);
     $element = new Element\Textarea('body');
     $element->setAttributes(array('size' => '30', 'class' => 'form-control editor', 'placeholder' => 'body'));
     $this->add($element);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Send', 'id' => 'submitbutton', 'class' => 'form-control btn btn-primary')));
 }
开发者ID:hopealive,项目名称:ds,代码行数:12,代码来源:NewsForm.php

示例8: __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 mentor');
     $this->add($group);
     // name
     $userName = new Text('userName');
     $userName->setLabel('Người dùng: ');
     $userName->setAttributes(['maxlength' => 255]);
     if ($options == 'edit') {
         $userName->setAttribute('disabled', 'disabled');
     }
     $this->add($userName);
     $group->addElement($userName);
     $filter->add(array('name' => 'userName', 'required' => $options == 'edit' ? false : 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 người dùng'))))));
     $userId = new Hidden('userId');
     $this->add($userId);
     $group->addElement($userId);
     $filter->add(array('name' => 'userId', 'required' => $options == 'edit' ? false : 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 người dùng'))))));
     // code
     $description = new Textarea('description');
     $description->setLabel('Mô tả mentor:');
     $description->setAttributes(['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ả môn học'))))));
     $subject = new Text('subject');
     $subject->setLabel('Tên môn:');
     $subject->setAttributes(['maxlength' => 255, 'style' => 'width:100% !important', 'placeholder' => 'Tên môn học']);
     $subject->setOptions(array('tagsinput' => true, 'description' => 'Tên môn học'));
     $this->add($subject);
     $group->addElement($subject);
     $filter->add(array('name' => 'subject', '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 tên môn'))))));
     $subjectId = new Hidden('subjectId');
     $subjectId->setLabel('Tên môn:');
     $this->add($subjectId);
     $group->addElement($subjectId);
     $filter->add(array('name' => 'subjectId', '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 tên môn'))))));
     $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/admin/expert/add'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/admin/expert/add' => 'Tiếp tục nhập', '/admin/expert/index' => '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,代码行数:45,代码来源:Expert.php

示例9: __construct

 public function __construct($serviceLocator, $options = null)
 {
     parent::__construct('AccountIndex');
     $this->setServiceLocator($serviceLocator);
     $this->setAttribute('method', 'post');
     $filter = $this->getInputFilter();
     $group = new DisplayGroup('Search');
     $group->setLabel('Tìm kiếm trợ giúp ??');
     $this->add($group);
     // search
     $search = new Text('search');
     $search->setLabel('Tôi cần giúp về: ');
     $search->setAttributes(['maxlength' => 255, 'class' => 'input-title', 'placeholder' => 'e.g. Need help debugging SASS/CSS for frontend in Rails app']);
     $this->add($search);
     $group->addElement($search);
     $filter->add(array('name' => 'search', 'required' => false, 'filters' => array(array('name' => 'StringTrim'))));
     $searchDetail = new Textarea('searchDetail');
     $searchDetail->setAttributes(['placeholder' => 'Thêm chi tiết giúp bạn nhận hỗ trợ nhanh hơn', 'class' => 'input-description']);
     $this->add($searchDetail);
     $group->addElement($searchDetail);
     $filter->add(array('name' => 'searchDetail', 'required' => false, 'filters' => array(array('name' => 'StringTrim'))));
     $subject = new Text('subject');
     $subject->setAttributes(['placeholder' => 'Thêm môn học']);
     $this->add($subject);
     $filter->add(array('name' => 'subject', 'required' => false, 'filters' => array(array('name' => 'StringTrim'))));
     $subjectId = new Hidden('subjectId');
     $this->add($subjectId);
     $filter->add(array('name' => 'subjectId', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn cần điền ít nhất là 1 môn học'))))));
     $budget = new Radio('budget');
     $budget->setValueOptions(['5' => '20', '10' => '40']);
     $this->add($budget);
     $filter->add(array('name' => 'budget', 'required' => false, 'filters' => array(array('name' => 'StringTrim'))));
     $email = new Text('email');
     $email->setLabel('Email');
     $this->add($email);
     $filter->add(array('name' => 'email', '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 email'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ'))))));
     $password = new Password('password');
     $password->setAttributes(array('type' => 'password', 'id' => 'password'));
     $password->setLabel('Mật khẩu:');
     $this->add($password);
     //$groupBasic->addElement($password);
     $filter->add(array('name' => 'password', 'required' => false, 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mật khẩu'))))));
     $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,代码行数:44,代码来源:SearchDetail.php

示例10: __construct

 /**
  * Form initialization.
  * 
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     // Job Name
     $name = new Element\Text('name');
     $name->setLabel('Job Name');
     $name->setAttributes(array('autocomplete' => 'off', 'class' => 'form-control'));
     $this->add($name);
     // Expression
     $expression = new Element\Text('expression');
     $expression->setLabel('Time');
     $expression->setValue('* * * * *');
     $expression->setAttributes(array('autocomplete' => 'off', 'class' => 'form-control'));
     $this->add($expression);
     // Command
     $command = new Element\Textarea('command');
     $command->setLabel('Command');
     $command->setAttributes(array('autocomplete' => 'off', 'class' => 'form-control command'));
     $this->add($command);
 }
开发者ID:Kingbalou,项目名称:cronkeep,代码行数:25,代码来源:AdvancedForm.php

示例11: __construct

 public function __construct($name = null)
 {
     parent::__construct('links');
     $weight_hidden = new Element\Hidden('weight');
     $title_text = new Element\Text('name');
     $title_text->setLabel('Title');
     $title_text->setLabelAttributes(array('class' => 'type_text'));
     $title_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => true));
     $url_text = new Element\Url('ref');
     $url_text->setLabel('Url');
     $url_text->setLabelAttributes(array('class' => 'type_text'));
     $url_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => true));
     $description_textarea = new Element\Textarea('description');
     $description_textarea->setLabel('Description');
     $description_textarea->setLabelAttributes(array('class' => 'type_text'));
     $description_textarea->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...'));
     $this->add($weight_hidden);
     $this->add($title_text);
     $this->add($url_text);
     $this->add($description_textarea);
 }
开发者ID:KukaBazuka,项目名称:zendy,代码行数:21,代码来源:LinksForm.php

示例12: addElements

 public function addElements()
 {
     $this->setAttribute('method', 'post');
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $element = new Element\Text('title');
     $element->setAttributes(array('size' => '30', 'class' => 'form-control', 'placeholder' => 'title'));
     $this->add($element);
     $element = new Element\Text('name');
     $element->setAttributes(array('size' => '30', 'class' => 'form-control', 'placeholder' => 'Название на английском одним словом', 'alt' => 'Название на английском одним словом', 'title' => 'Название на английском одним словом'));
     $this->add($element);
     $element = new Element\Select('category_id');
     $element->setAttributes(array('class' => 'form-control ', 'placeholder' => 'category'));
     $this->add($element);
     $element = new Element\File('thumb', array('required' => false));
     $element->setLabel('Preview')->setOptions(array('required' => false))->setAttributes(array('required' => false, 'class' => 'form-control', 'placeholder' => 'preview'));
     $this->add($element);
     $element = new Element\Textarea('body');
     $element->setAttributes(array('size' => '30', 'class' => 'form-control  editor', 'placeholder' => 'body'));
     $this->add($element);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Send', 'id' => 'submitbutton', 'class' => 'form-control btn btn-primary')));
 }
开发者ID:hopealive,项目名称:ds,代码行数:21,代码来源:ShopProductForm.php

示例13: __construct

 public function __construct($name = null)
 {
     parent::__construct('filmes');
     $this->setAttribute('enctype', 'multipart/form-data');
     $id = new Hidden('filmes_id');
     $nome = new Text('filmes_nome');
     $nome->setLabel('Nome: ');
     $nome->setAttributes(array('class' => 'form-control', 'id' => 'filmes_nome'));
     $preco = new Text('filmes_preco');
     $preco->setLabel('Valor Aluguel: ');
     $preco->setAttributes(array('class' => 'form-control', 'id' => 'filmes_preco'));
     $categoria = new Select('categoria_id');
     $categoria->setLabel('Categoria: ');
     $categoria->setAttributes(array('class' => 'form-control', 'id' => 'categoria_id', 'empty_option' => 'Please select an author', 'value_options' => $this->getOptionsForSelect()));
     $foto = new File('filmes_foto');
     $foto->setLabel('Cartaz: ');
     $foto->setAttributes(array('class' => 'form-control'));
     $descricao = new Textarea('filmes_descricao');
     $descricao->setLabel('Dados do Filme: ');
     $descricao->setAttributes(array('style' => 'height: 100px;', 'class' => 'form-control', 'id' => 'filmes_descricao'));
     $status = new Checkbox('filmes_status');
     $status->setLabel("Mostrar?");
     $status->setValue(1);
     $submit = new Button('submit');
     $submit->setLabel('Cadastrar');
     $submit->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success'));
     $cancel = new Button('cancel');
     $cancel->setLabel('Cancelar');
     $cancel->setAttributes(array('type' => 'button', 'class' => 'btn btn-default', 'onclick' => 'javascript:history.go(-1)'));
     $this->add($id);
     $this->add($nome);
     $this->add($preco);
     $this->add($foto);
     $this->add($descricao);
     $this->add($categoria);
     $this->add($status);
     $this->add($submit);
     $this->add($cancel);
 }
开发者ID:bjardim2003,项目名称:pontual,代码行数:39,代码来源:FilmesForm.php

示例14: __construct

 public function __construct(EntityManager $entityManager)
 {
     parent::__construct();
     $this->entityManager = $entityManager;
     $this->setAttributes(array("method" => "post", "enctype" => "multipart/form-data", "class" => "form"));
     $this->setInputFilter(new GuiaVersoesFilters());
     // Campo de titulo
     $titulo = new Text('titulo');
     $titulo->setLabel("* Título")->setAttributes(array("maxLength" => "200", "class" => "form-control", "required" => "required"));
     // Campo de resposta
     $descricao = new Textarea('descricao');
     $descricao->setLabel('* Descrição');
     $descricao->setAttributes(array('class' => 'file form-control editor', 'cols' => '30', 'rows' => '10'));
     // Campo de midia
     $file = new File("midia");
     $file->setLabel('*Imagem (Tamanho exato de ' . \Base\Constant\Upload::VERSOES_WIDTH . 'x' . \Base\Constant\Upload::VERSOES_HEIGTH . ' px | ' . \Base\Constant\Upload::VERSOES_MAX_SIZE . ')')->setAttribute('name', 'midia')->setAttribute('id', 'image');
     // Botão de Submit
     $botao = new Submit("submit");
     $botao->setAttributes(array("value" => "Salvar"));
     // Adiciona campos
     $this->add($titulo)->add($descricao)->add($file)->add($botao);
 }
开发者ID:kayo-almeida,项目名称:cms-zend,代码行数:22,代码来源:GuiaVersoesForm.php

示例15: __construct

 public function __construct($name = null)
 {
     parent::__construct('terms');
     $id_hidden = new Element\Hidden('id');
     $id_hidden->setName('id');
     $orders_radio = new Element\Radio('custom_orders');
     $orders_radio->setLabel('Custom orders');
     $orders_radio->setValueOptions(array('0' => 'No', '1' => 'Yes'));
     $shipping_select = new Element\Select('shipping');
     $shipping_select->setLabel('Shipping');
     $shipping_select->setLabelAttributes(array('class' => 'select f_3_w50'));
     $shipping_select->setAttributes(array('class' => 'sel_chosen'));
     $shipping_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your shipping'));
     $policies_text = new Element\Textarea('wholesale_policies');
     $policies_text->setLabel('Wholesale policies');
     $policies_text->setLabelAttributes(array('class' => 'type_text'));
     $policies_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...'));
     $this->add($id_hidden);
     $this->add($orders_radio);
     $this->add($shipping_select);
     $this->add($policies_text);
 }
开发者ID:KukaBazuka,项目名称:zendy,代码行数:22,代码来源:TermsForm.php


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