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


PHP Select::setLabelAttributes方法代码示例

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


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

示例1: __construct

 public function __construct($name = null, $options = array())
 {
     parent::__construct(isset($name) ? $name : 'personal');
     $id_hidden = new Element\Hidden('id');
     $id_hidden->setName('id');
     $firstname_text = new Element\Text('firstname');
     $firstname_text->setLabel('First name');
     $firstname_text->setLabelAttributes(array('class' => 'type_text'));
     $firstname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...'));
     $lastname_text = new Element\Text('lastname');
     $lastname_text->setLabel('Last name');
     $lastname_text->setLabelAttributes(array('class' => 'type_text'));
     $lastname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => true));
     $country_select = new Element\Select('country_id');
     $country_select->setLabel('Country');
     $country_select->setLabelAttributes(array('class' => 'select f_3_w50'));
     $country_select->setAttributes(array('class' => 'sel_chosen'));
     $country_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your country'));
     $state_select = new Element\Select('state_id');
     $state_select->setLabel('Province/State');
     $state_select->setLabelAttributes(array('class' => 'select f_3_w50'));
     $state_select->setAttributes(array('class' => 'sel_chosen', 'required' => true));
     $state_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your state'));
     $city_select = new Element\Select('city_id');
     $city_select->setLabel('City');
     $city_select->setLabelAttributes(array('class' => 'select f_3_w50'));
     $city_select->setAttributes(array('class' => 'sel_chosen', 'required' => true));
     $city_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your city'));
     $adress_text = new Element\Text('adress');
     $adress_text->setLabel('Adress');
     $adress_text->setLabelAttributes(array('class' => 'type_text'));
     $adress_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type adress in format (наш формат)'));
     $languages_select = new Element\Select('languages');
     $languages_select->setLabel('Languages');
     $languages_select->setLabelAttributes(array('class' => 'select', 'style' => 'float:left;'));
     $languages_select->setAttributes(array('class' => 'sel_chosen', 'multiple' => 'multiple', 'required' => true));
     $languages_select->setOptions(array('disable_inarray_validator' => true));
     $logo = new Element\Image('logo');
     $logo->setAttributes(array('src', '/images/11.jpg', 'style' => 'float:left;'));
     $file = new Element\File('file');
     $file->setLabelAttributes(array('style' => 'float:left;clear:both'));
     $this->add($id_hidden);
     $this->add($firstname_text);
     $this->add($lastname_text);
     $this->add($country_select);
     $this->add($state_select);
     $this->add($city_select);
     $this->add($adress_text);
     $this->add($languages_select);
     $this->add($logo);
     $this->add($file);
 }
开发者ID:KukaBazuka,项目名称:zendy,代码行数:52,代码来源:PersonalForm.php

示例2: addSelect

 protected function addSelect($name, $label, array $values)
 {
     $select = new Element\Select($name);
     $select->setLabel($label);
     $select->setLabelAttributes(array('class' => "col-sm-{$this->labelWidth}"));
     $select->setOption('column-size', "sm-{$this->controlWidth}");
     $select->setValueOptions($values);
     if ($this->compact) {
         $select->setAttribute('class', 'input-sm');
     }
     $this->add($select);
     return $this;
 }
开发者ID:srayner,项目名称:cobalt,代码行数:13,代码来源:HorizontalForm.php

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

示例4: __construct

 public function __construct($name = null, $options = array())
 {
     parent::__construct(isset($name) ? $name : 'about');
     $id_hidden = new Element\Hidden('id');
     $id_hidden->setName('id');
     $specialty_text = new Element\Text('specialty');
     $specialty_text->setLabel('Specialty');
     $specialty_text->setLabelAttributes(array('class' => 'type_text'));
     $specialty_text->setAttributes(array('class' => 'type_text_input'));
     $proficiency_select = new Element\Select('proficiency_level');
     $proficiency_select->setLabel('Proficiency level');
     $proficiency_select->setLabelAttributes(array('class' => 'select f_3_w50'));
     $proficiency_select->setAttributes(array('class' => 'sel_chosen'));
     $proficiency_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your proficiency'));
     $about_textarea = new Element\Textarea('about');
     $about_textarea->setLabel('About');
     $about_textarea->setLabelAttributes(array('class' => 'type_text'));
     $about_textarea->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require'));
     $this->add($id_hidden);
     $this->add($specialty_text);
     $this->add($proficiency_select);
     $this->add($about_textarea);
 }
开发者ID:KukaBazuka,项目名称:zendy,代码行数:23,代码来源:AboutForm.php

示例5: __construct

 public function __construct($name = null)
 {
     parent::__construct('services');
     $id_hidden = new Element\Hidden('id');
     $id_hidden->setName('id');
     $tutorial_select = new Element\Select('tutorial_status');
     $tutorial_select->setLabel('Tutorial status');
     $tutorial_select->setLabelAttributes(array('class' => 'select f_3_w50'));
     $tutorial_select->setAttributes(array('class' => 'sel_chosen'));
     $tutorial_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your status'));
     $members_select = new Element\Textarea('members_special');
     $members_select->setLabel('Members Special');
     $members_select->setLabelAttributes(array('class' => 'type_text'));
     $members_select->setAttributes(array('class' => 'type_text_input'));
     $this->add($id_hidden);
     $this->add($tutorial_select);
     $this->add($members_select);
     $this->add(array('type' => 'Profile\\Form\\AdressesFieldset'));
 }
开发者ID:KukaBazuka,项目名称:zendy,代码行数:19,代码来源:ServicesForm.php

示例6: __construct

 public function __construct($name = null)
 {
     parent::__construct('contacts');
     $id_hidden = new Element\Hidden('id');
     $id_hidden->setName('id');
     $contacts_select = new Element\Select('contacts');
     $contacts_select->setLabel('Contacts');
     $contacts_select->setLabelAttributes(array('class' => 'select f_3_w50'));
     $contacts_select->setAttributes(array('class' => 'sel_chosen'));
     $contacts_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your link', 'required' => false));
     $this->add($id_hidden);
     $this->add($contacts_select);
     $this->add(array('type' => 'Profile\\Form\\LinksFieldset'));
 }
开发者ID:KukaBazuka,项目名称:zendy,代码行数:14,代码来源:ContactsForm.php


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