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


PHP FormBuilder::select方法代码示例

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


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

示例1: select

 public function select($name, $list = array(), $selected = null, $options = array())
 {
     if (strpos(@$options['class'], 'form-control') === false) {
         @($options['class'] .= ' form-control');
     }
     return parent::select($name, $list, $selected, $options);
 }
开发者ID:rtconner,项目名称:laravel-plusplus,代码行数:7,代码来源:BootstrapFormBuilder.php

示例2: select

 /**
  * Create a select box field.
  *
  * @param  string  $name
  * @param  array   $list
  * @param  string  $selected
  * @param  array   $options
  * @return string
  */
 public function select($name, $list = array(), $selected = null, $options = array(), $label = '')
 {
     if (!self::$is_bootstrap) {
         return parent::select($name, $list, $selected, $options);
     }
     $label_text = $label == '' ? $this->transformKey($name) : $label;
     $options = $this->appendClassToOptions('form-control', $options);
     // Call the parent select method so that Laravel can handle
     // the rest of the select set up.
     return $this->openGroup($name, $label_text) . parent::select($name, $list, $selected, $options) . $this->closeGroup($name);
 }
开发者ID:shyam-achuthan,项目名称:laravel5bootstrap3form,代码行数:20,代码来源:FormBuilder.php

示例3: select

 public function select($name, $list = [], $selected = null, $options = [])
 {
     $label = array_get($options, 'label', $this->translationDomain ? $this->translationDomain . '.' . $name : $name);
     unset($options['label']);
     $label = \Lang::get($label);
     $options = $this->getFieldOptions($options);
     $wrapperOptions = ['class' => $this->getRightColumnClass()];
     $inputElement = $this->form->select($name, $list, $selected, $options);
     $groupElement = '<div ' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . '</div>';
     return $this->getFormGroup($name, $label, $groupElement);
 }
开发者ID:Junyue,项目名称:zidisha2,代码行数:11,代码来源:BootstrapFormBuilder.php

示例4: select

 /**
  * Generate a select field.
  *
  * @param        $name
  * @param string $value
  * @param array  $options
  *
  * @return string
  */
 public function select($name, $value = null, $options = [])
 {
     $select_options = [];
     // Loop through, and pluck out the select box list options
     // from the $options array, then remove the select options.
     foreach ($options as $key => $label) {
         if (is_array($label)) {
             $select_options = $label;
             unset($options[$key]);
         }
     }
     return $this->formBuilder->select($name, $select_options, $value, $options);
 }
开发者ID:kamaroly,项目名称:shift,代码行数:22,代码来源:FieldBuilder.php

示例5: options

 /**
  * Create a form select field.
  *
  * @param string                         $name
  * @param string                         $label
  * @param array                          $list
  * @param string                         $selected
  * @param \Illuminate\Support\MessageBag $errors
  * @param array                          $options
  *
  * @return string
  */
 protected function options($name, $label = null, array $list = array(), $selected = null, $errors = null, array $options = array())
 {
     $options = array_merge(array('class' => 'form-control'), $options);
     $return = $this->group($name, $errors);
     $return .= $this->label($name, $label);
     if ($this->formType == self::FORM_HORIZONTAL) {
         $return .= $this->group('', null, $this->inputClass);
     }
     $return .= $this->form->select($name, $list, $selected, $options) . "\n";
     $return .= $this->errors($name, $errors);
     if ($this->formType == self::FORM_HORIZONTAL) {
         $return .= '</div>' . "\n";
     }
     $return .= '</div>' . "\n";
     return $return;
 }
开发者ID:illuminate3,项目名称:bootawesome,代码行数:28,代码来源:BootstrapBase.php

示例6: options

 /**
  * Create a form select field.
  *
  * @param string                         $name
  * @param string                         $label
  * @param array                          $list
  * @param string                         $selected
  * @param \Illuminate\Support\MessageBag $errors
  * @param array                          $options
  *
  * @return string
  */
 protected function options($name, $label = null, array $list = array(), $selected = null, $errors = null, array $options = array())
 {
     $return = '';
     $options = array_merge(array('class' => 'form-control', 'id' => $name), $options);
     $containerAttributes = $this->getContainerAttributes($options);
     $labelAttributes = $this->getLabelAttributes($options);
     if (!isset($containerAttributes['display'])) {
         $return .= $this->group($name, $errors, 'form-group', $containerAttributes);
     }
     $return .= $this->label($name, $label, $labelAttributes);
     if ($this->formType == self::FORM_HORIZONTAL) {
         $return .= $this->group('', null, $this->inputClass);
     }
     $return .= $this->form->select($name, $list, $selected, $options) . "\n";
     $return .= $this->errors($name, $errors);
     if ($this->formType == self::FORM_HORIZONTAL) {
         $return .= '</div>' . "\n";
     }
     if (!isset($containerAttributes['display'])) {
         $return .= '</div>' . "\n";
     }
     return $return;
 }
开发者ID:jamalapriadi,项目名称:sia,代码行数:35,代码来源:BootstrapBase.php

示例7: selectField

 /**
  * @param Field $field
  * @return string
  */
 public function selectField(Field $field)
 {
     return $this->builder->select($field->name, $field->options ?: [], $field->value, $field->getAttributes());
 }
开发者ID:iyoworks,项目名称:form-builder,代码行数:8,代码来源:LaravelFormRenderer.php

示例8: select

 /**
  * Create a select box field with empty option support.
  * @param  string  $name
  * @param  array   $list
  * @param  string  $selected
  * @param  array   $options
  * @return string
  */
 public function select($name, $list = [], $selected = null, $options = [])
 {
     if (array_key_exists('emptyOption', $options)) {
         $list = ['' => $options['emptyOption']] + $list;
     }
     return parent::select($name, $list, $selected, $options);
 }
开发者ID:mechiko,项目名称:staff-october,代码行数:15,代码来源:FormBuilder.php

示例9: select

 /**
  * Create a select box field.
  *
  * @param  string  $name
  * @param  array   $list
  * @param  string  $selected
  * @param  array   $options
  *
  * @return string
  */
 public function select($name, $list = array(), $selected = null, $options = [])
 {
     $this->addErrorClass($name, $options);
     $tags['input'] = parent::select($name, $list, $selected, $options);
     $tags['error'] = $this->getErrorTag($name);
     return $this->buildTags($tags);
 }
开发者ID:stolz,项目名称:laravel-form-builder,代码行数:17,代码来源:Foundation.php

示例10: select

 public function select($name, $list = [], $selected = null, $options = [])
 {
     $options = array_merge($options, $this->parsley->getFieldRules($name));
     return parent::select($name, $list, $selected, $options);
 }
开发者ID:idma,项目名称:laravel-parsley,代码行数:5,代码来源:FormBuilder.php

示例11: select

 /**
  * {@inheritdoc}
  * @param string $name
  * @param array  $list
  * @param null   $selected
  * @param array  $attributes
  * @return string
  */
 public function select($name, $list = array(), $selected = null, $attributes = array())
 {
     $attributes['class'] = isset($attributes['class']) ? self::FORM_CONTROL . ' ' . $attributes['class'] : self::FORM_CONTROL;
     return parent::select($name, $list, $selected, $attributes);
 }
开发者ID:olax,项目名称:epetitions,代码行数:13,代码来源:Form.php

示例12: select

 /**
  * Create a select box field.
  *
  * @param  string $name
  * @param  array  $list
  * @param  string $selected
  * @param  array  $options
  * @return string
  */
 public function select($name, $list = array(), $selected = null, $options = array())
 {
     $options = $this->addErrorClass($name, $options);
     $options = $this->checkRequired($name, $options);
     return parent::select($name, $list, $selected, $options);
 }
开发者ID:artisaninweb,项目名称:laravel-formvalidation-helper,代码行数:15,代码来源:FormBuilder.php

示例13: select

 /**
  * @see Illuminate\Html\FormBuilder
  */
 public function select($name, $list = [], $selected = null, $options = [])
 {
     $options = $this->laravelToJquery($name) + $options;
     return parent::select($name, $list, $selected, $options);
 }
开发者ID:bllim,项目名称:laravel-to-jquery-validation,代码行数:8,代码来源:FormBuilder.php

示例14: select

 /**
  * @see Illuminate\Html\FormBuilder
  */
 public function select($name, $list = [], $selected = null, $options = [])
 {
     $options = $this->converter->convert(Helper::getFormAttribute($name)) + $options;
     return parent::select($name, $list, $selected, $options);
 }
开发者ID:jitheshgopan,项目名称:laravalid,代码行数:8,代码来源:FormBuilder.php

示例15: select

 /**
  * Create a HTML select element.
  *
  * @param  string  $name
  * @param  string  $label
  * @param  array   $options
  * @param  string  $selected
  * @param  array   $attributes
  * @return string
  */
 public function select($name, $label = '', $options = null, $selected = null, $attributes = array())
 {
     $modelOptions = null;
     if (is_null($options)) {
         $modelOptions = $this->getModelOptions($name);
     }
     if (!is_null($modelOptions)) {
         $options = $modelOptions;
     }
     $selected = $this->calculateValue($name, $selected);
     $attributes = $this->setAttributes($name, $attributes);
     $field = parent::select($name, $options, $selected, $attributes);
     return $this->buildWrapper($field, $name, $label);
 }
开发者ID:jarnstedt,项目名称:former,代码行数:24,代码来源:Former.php


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