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


PHP Textarea::setAttribute方法代码示例

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


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

示例1: __construct

 public function __construct($name = NULL)
 {
     parent::__construct('cityForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'form-horizontal');
     $this->add(array('name' => 'ctCatName', 'attributes' => array('type' => 'text', 'placeholder' => 'Add City Category', 'class' => 'commonDropDnInput')));
     $ctCatInfo = new Element\Textarea('ctCatInfo');
     $ctCatInfo->setLabel('Category Information');
     $ctCatInfo->setAttribute("class", "selectAreaInput");
     $ctCatInfo->setAttribute("rows", "4");
     $ctCatInfo->setAttribute("cols", "50");
     $this->add($ctCatInfo);
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
开发者ID:viplovegithub,项目名称:Myzend,代码行数:25,代码来源:CityCategoryForm.php

示例2: __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', 'form-control');
     $nota->setAttribute('style', 'min-height:180px;');
     $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,代码行数:28,代码来源:Content.php

示例3: init

 public function init()
 {
     $code = new Text('code');
     $code->setAttribute('id', 'code');
     $code->setAttribute('required', 'required')->setAttribute('class', 'form-control')->setAttribute('readonly', 'readonly')->setAttribute('placeholder', $this->translator->translate('template.form.code.placeholder'))->setLabel($this->translator->translate('template.form.code.label'));
     $this->add($code);
     $name = new Text('name');
     $name->setAttribute('id', 'name');
     $name->setAttribute('required', 'required')->setAttribute('class', 'form-control')->setAttribute('placeholder', $this->translator->translate('template.form.name.placeholder'))->setLabel($this->translator->translate('template.form.name.label'));
     $this->add($name);
     $titleEt = new Text('titleEt');
     $titleEt->setAttribute('id', 'titleEt');
     $titleEt->setAttribute('required', 'required')->setAttribute('class', 'form-control')->setAttribute('placeholder', $this->translator->translate('template.form.titleEt.placeholder'))->setLabel($this->translator->translate('template.form.titleEt.label'));
     $this->add($titleEt);
     $titleEn = new Text('titleEn');
     $titleEn->setAttribute('id', 'titleEn');
     $titleEn->setAttribute('required', 'required')->setAttribute('class', 'form-control')->setAttribute('placeholder', $this->translator->translate('template.form.titleEn.placeholder'))->setLabel($this->translator->translate('template.form.titleEn.label'));
     $this->add($titleEn);
     $contentEt = new Textarea('contentEt');
     $contentEt->setAttribute('id', 'contentEt');
     $contentEt->setAttribute('required', 'required')->setAttribute('class', 'editor')->setAttribute('placeholder', $this->translator->translate('template.form.contentEt.placeholder'))->setLabel($this->translator->translate('template.form.contentEt.label'));
     $contentEt->setAttribute('cols', 15);
     $contentEt->setAttribute('rows', 4);
     $this->add($contentEt);
     $contentEn = new Textarea('contentEn');
     $contentEn->setAttribute('id', 'contentEn');
     $contentEn->setAttribute('required', 'required')->setAttribute('class', 'editor')->setAttribute('placeholder', $this->translator->translate('template.form.contentEn.placeholder'))->setLabel($this->translator->translate('template.form.contentEn.label'));
     $contentEn->setAttribute('cols', 15);
     $contentEn->setAttribute('rows', 4);
     $this->add($contentEn);
     return $this;
 }
开发者ID:kristjanAnd,项目名称:SimpleIV,代码行数:32,代码来源:TemplateForm.php

示例4: form

 public function form(PhpRenderer $view, SiteRepresentation $site, SitePageBlockRepresentation $block = null)
 {
     $textarea = new Textarea("o:block[__blockIndex__][o:data][html]");
     $textarea->setAttribute('class', 'block-html full wysiwyg');
     if ($block) {
         $textarea->setAttribute('value', $this->getData($block->data(), 'html'));
     }
     return $this->thumbnailTypeSelect($view, $site, $block) . $this->attachmentsForm($view, $site, $block) . $view->formRow($textarea);
 }
开发者ID:patrova,项目名称:omeka-s,代码行数:9,代码来源:FileWithText.php

示例5: __construct

 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('CityForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $this->add(array('name' => 'ctname', 'attributes' => array('type' => 'text', 'placeholder' => 'City name', 'class' => 'commonDropDnInput')));
     $stid = new Element\Select('stid');
     $stid->setLabel('State name');
     $stid->setAttributes(array('id' => 'stid'));
     $stid->setValueOptions($this->getOptionState());
     $stid->setAttribute("class", "dropDnInput");
     $this->add($stid);
     $ctcatid = new Element\Select('ctcatid');
     $ctcatid->setLabel('City category');
     $ctcatid->setValueOptions($this->getOptionCityCat());
     $ctcatid->setAttribute("class", "dropDnInput");
     $this->add($ctcatid);
     $ctdescription = new Element\Textarea('ctdescription');
     $ctdescription->setLabel('City Description');
     $ctdescription->setAttribute("class", "selectAreaInput");
     $ctdescription->setAttribute("rows", "4");
     $ctdescription->setAttribute("cols", "50");
     $this->add($ctdescription);
     $ctspecialInstructions = new Element\Textarea('ctspecialInstructions');
     $ctspecialInstructions->setLabel('City Special Instruction Description');
     $ctspecialInstructions->setAttribute("class", "selectAreaInput");
     $ctspecialInstructions->setAttribute("rows", "4");
     $ctspecialInstructions->setAttribute("cols", "33");
     $this->add($ctspecialInstructions);
     $ctbestSeasonToVisit = new Element\Textarea('ctbestSeasonToVisit');
     $ctbestSeasonToVisit->setLabel('City Best Season to visit');
     $ctbestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $ctbestSeasonToVisit->setAttribute("rows", "4");
     $ctbestSeasonToVisit->setAttribute("cols", "43");
     $this->add($ctbestSeasonToVisit);
     $this->add(array('name' => 'ctlatitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'ctlongitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'cityPhoto', 'attributes' => array('type' => 'file'), 'options' => array('label' => 'File Upload')));
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
开发者ID:viplovegithub,项目名称:Myzend,代码行数:53,代码来源:CityForm.php

示例6: load

 /**
  * Load upload editor
  *
  * @return string
  */
 public function load()
 {
     $data = unserialize($this->getValue());
     $property = $this->getProperty();
     $textarea = new Element\Textarea($this->getName());
     $textarea->setAttribute('id', $this->getName());
     $textarea->setAttribute('class', 'form-control');
     $textarea->setAttribute('required', $property->isRequired());
     $textarea->setLabel($this->getProperty()->getName());
     $textarea->setValue(!empty($data['source']) ? $data['source'] : '');
     return $this->addPath(__DIR__)->render('markdown-editor.phtml', array('textarea' => $textarea, 'id' => $this->getName(), 'value' => $this->getValue(), 'property' => $property));
 }
开发者ID:gotcms,项目名称:gotcms,代码行数:17,代码来源:Editor.php

示例7: __construct

 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('StateForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $country = new Element\Select('cntryId');
     $country->setLabel('Country name');
     $country->setValueOptions($this->getOptionCountry());
     $country->setAttribute("class", "dropDnInput");
     $this->add($country);
     $this->add(array('name' => 'stname', 'attributes' => array('type' => 'text', 'placeholder' => 'State name', 'class' => 'commonDropDnInput')));
     $cntrydescription = new Element\Textarea('statedescription');
     $cntrydescription->setLabel('State Description');
     $cntrydescription->setAttribute("class", "selectAreaInput");
     $cntrydescription->setAttribute("rows", "4");
     $cntrydescription->setAttribute("cols", "50");
     $this->add($cntrydescription);
     $cntryspecialInstructions = new Element\Textarea('statespecialInstructions');
     $cntryspecialInstructions->setLabel('State Special Instruction Description');
     $cntryspecialInstructions->setAttribute("class", "selectAreaInput");
     $cntryspecialInstructions->setAttribute("rows", "4");
     $cntryspecialInstructions->setAttribute("cols", "50");
     $this->add($cntryspecialInstructions);
     $cntrybestSeasonToVisit = new Element\Textarea('statebestSeasonToVisit');
     $cntrybestSeasonToVisit->setLabel('State Best Season to visit');
     $cntrybestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $cntrybestSeasonToVisit->setAttribute("rows", "4");
     $cntrybestSeasonToVisit->setAttribute("cols", "50");
     $this->add($cntrybestSeasonToVisit);
     $this->add(array('name' => 'latitude', 'attributes' => array('type' => 'text', 'placeholder' => 'State Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'longitude', 'attributes' => array('type' => 'text', 'placeholder' => 'State Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'statePhoto', 'attributes' => array('type' => 'file', 'allowEmpty' => False), 'options' => array('label' => 'File Upload')));
     //
     // File Input
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
开发者ID:viplovegithub,项目名称:Myzend,代码行数:49,代码来源:StateForm.php

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

示例9: __construct

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

示例10: init

 /**
  * Init Module form
  *
  * @return void
  */
 public function init()
 {
     $showEmail = new Element\Checkbox('show_email');
     $showEmail->setLabel('Show email');
     $showEmail->setAttribute('required', 'required')->setAttribute('id', 'show-email');
     $username = new Element\Text('username');
     $username->setLabel('Username');
     $username->setAttribute('required', 'required')->setAttribute('id', 'username');
     $email = new Element\Text('email');
     $email->setLabel('Email');
     $email->setAttribute('required', 'required')->setAttribute('id', 'email');
     $message = new Element\Textarea('message');
     $message->setLabel('Message');
     $message->setAttribute('required', 'required')->setAttribute('id', 'message');
     $captchaImage = new CaptchaImage(array('font' => GC_PUBLIC_PATH . '/backend/fonts/arial.ttf', 'width' => 250, 'height' => 50, 'dotNoiseLevel' => 40, 'lineNoiseLevel' => 3));
     $captchaImage->setImgDir(GC_PUBLIC_PATH . '/frontend/tmp');
     $captchaImage->setImgUrl('/frontend/tmp');
     $captcha = new Element\Captcha('captcha');
     $captcha->setLabel('Please verify you are human')->setCaptcha($captchaImage)->setAttribute('required', 'required')->setAttribute('id', 'captcha');
     $this->add($showEmail);
     $this->add($username);
     $this->add($email);
     $this->add($message);
     $this->add($captcha);
     $inputFilterFactory = new InputFilterFactory();
     $inputFilter = $inputFilterFactory->createInputFilter(array('show_email' => array('name' => 'show_email', 'required' => false), 'username' => array('name' => 'username', 'required' => true), 'email' => array('name' => 'email', 'required' => true, 'validators' => array(array('name' => 'email_address'))), 'message' => array('name' => 'message', 'required' => true), 'captcha' => $captcha->getInputSpecification()));
     $this->setInputFilter($inputFilter);
 }
开发者ID:gotcms,项目名称:gotcms,代码行数:33,代码来源:Comment.php

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

示例12: addDescriptionElement

 /**
  * 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);
 }
开发者ID:andreaszobl,项目名称:software,代码行数:10,代码来源:RentalsForm.php

示例13: __construct

 public function __construct($name = null)
 {
     parent::__construct($name);
     //id
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden', 'class' => 'id', 'id' => 'idpostit')));
     //xyz
     $this->add(array('name' => 'xyz', 'attributes' => array('type' => 'hidden', 'class' => 'xyz')));
     //nome
     $this->add(array('name' => 'nome', 'attributes' => array('type' => 'hidden', 'id' => 'note-name', 'class' => 'pr-author')));
     //messaggio
     /* $this->add(array(
            'name'=>'messaggio',
            'options'=>array(
                'label'=> 'Messaggio',
            ),
            'attributes'=> array(
                'type'=>'text',
                'class'=>'form-control pr-body pull-left',
                'id'=>'note-body',
                'placeholder'=>'Messaggio',
            ),
        ));*/
     $nota = new Element\Textarea('messaggio');
     $nota->setLabel('Contenuto');
     $nota->setAttribute('class', 'mintxt pr-body');
     $nota->setAttribute('placeholder', 'Scrivi qui il testo dell\'intervento');
     $nota->setAttribute('required', 'required');
     $this->add($nota);
     //color
     $this->add(array('name' => 'color', 'attributes' => array('type' => 'hidden', 'class' => 'color')));
     //posterlab
     $this->add(array('name' => 'posterlab', 'attributes' => array('type' => 'hidden', 'class' => 'posterlab')));
     //tipo
     $this->add(array('name' => 'tipo', 'attributes' => array('type' => 'hidden', 'class' => 'tipo')));
     //sessione
     $this->add(array('name' => 'sessione', 'attributes' => array('type' => 'hidden', 'class' => 'sessione')));
     //data
     $this->add(array('name' => 'data', 'attributes' => array('type' => 'hidden', 'class' => 'fecha')));
     //stato
     $this->add(array('name' => 'stato', 'attributes' => array('type' => 'hidden', 'class' => 'stato')));
     $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => 'Invia', 'class' => 'button expand purple', 'id' => 'note-submit', 'style' => 'margin:0px !important', 'onClick' => 'return false')));
 }
开发者ID:sebaxplace,项目名称:skilla-local,代码行数:42,代码来源:Nascosto.php

示例14: __construct

 public function __construct($name = NULL)
 {
     parent::__construct('CountryForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $this->add(array('name' => 'cntryName', 'attributes' => array('type' => 'text', 'placeholder' => 'Country name', 'class' => 'commonDropDnInput')));
     $cntrydescription = new Element\Textarea('cntrydescription');
     $cntrydescription->setLabel('Country Description');
     $cntrydescription->setAttribute("class", "selectAreaInput");
     $cntrydescription->setAttribute("rows", "4");
     $cntrydescription->setAttribute("cols", "39");
     $this->add($cntrydescription);
     $cntryspecialInstructions = new Element\Textarea('cntryspecialInstructions');
     $cntryspecialInstructions->setLabel('Country Special Instruction Description');
     $cntryspecialInstructions->setAttribute("class", "selectAreaInput");
     $cntryspecialInstructions->setAttribute("rows", "4");
     $cntryspecialInstructions->setAttribute("cols", "23");
     $this->add($cntryspecialInstructions);
     $cntrybestSeasonToVisit = new Element\Textarea('cntrybestSeasonToVisit');
     $cntrybestSeasonToVisit->setLabel('Country Best Season to Visit');
     $cntrybestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $cntrybestSeasonToVisit->setAttribute("rows", "4");
     $cntrybestSeasonToVisit->setAttribute("cols", "33");
     $this->add($cntrybestSeasonToVisit);
     $this->add(array('name' => 'latitude', 'attributes' => array('type' => 'text', 'placeholder' => 'Country Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'longitude', 'attributes' => array('type' => 'text', 'placeholder' => 'Country Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'contryphoto', 'attributes' => array('type' => 'file'), 'options' => array('label' => 'File Upload')));
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
开发者ID:viplovegithub,项目名称:Myzend,代码行数:41,代码来源:CountryForm.php

示例15: init

 /**
  * Initialize form
  *
  * @return void
  */
 public function init()
 {
     $this->setAttribute('class', 'relative form-horizontal');
     $inputFilterFactory = new InputFilterFactory();
     $inputFilter = $inputFilterFactory->createInputFilter(array('name' => array('required' => true, 'validators' => array(array('name' => 'not_empty'), array('name' => 'db\\no_record_exists', 'options' => array('table' => $this->tableName, 'field' => 'name', 'adapter' => $this->getAdapter())))), 'identifier' => array('required' => true, 'validators' => array(array('name' => 'not_empty'), array('name' => 'regex', 'options' => array('pattern' => parent::IDENTIFIER_PATTERN)), array('name' => 'db\\no_record_exists', 'options' => array('table' => $this->tableName, 'field' => 'identifier', 'adapter' => $this->getAdapter()))))));
     $this->setInputFilter($inputFilter);
     $name = new Element\Text('name');
     $name->setLabel('Name')->setLabelAttributes(array('class' => 'required control-label col-lg-2'));
     $name->setAttribute('class', 'form-control')->setAttribute('id', 'name');
     $this->add($name);
     $identifier = new Element\Text('identifier');
     $identifier->setLabel('Identifier')->setLabelAttributes(array('class' => 'required control-label col-lg-2'));
     $identifier->setAttribute('class', 'form-control')->setAttribute('id', 'identifier');
     $this->add($identifier);
     $description = new Element\Text('description');
     $description->setLabel('Description')->setLabelAttributes(array('class' => 'control-label col-lg-2'));
     $description->setAttribute('class', 'form-control')->setAttribute('id', 'description');
     $this->add($description);
     $content = new Element\Textarea('content');
     $content->setLabel('Content')->setLabelAttributes(array('class' => 'control-label col-lg-2'));
     $content->setAttribute('cols', '80')->setAttribute('rows', '24')->setAttribute('id', 'content');
     $this->add($content);
 }
开发者ID:gotcms,项目名称:gotcms,代码行数:28,代码来源:AbstractFormContent.php


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