當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FormBuilder::input方法代碼示例

本文整理匯總了PHP中Collective\Html\FormBuilder::input方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormBuilder::input方法的具體用法?PHP FormBuilder::input怎麽用?PHP FormBuilder::input使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Collective\Html\FormBuilder的用法示例。


在下文中一共展示了FormBuilder::input方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: commonInputs

 private function commonInputs($type, $name, $value = null, $options = [])
 {
     return sprintf('
     <div class="input-field col l6 s8 offset-l3 offset-s2">
         %s
         %s
     </div>', parent::input($type, $name, $value, $options), parent::label($name, null, []));
 }
開發者ID:codificar,項目名稱:scaffolder-theme-material,代碼行數:8,代碼來源:MaterialThemeForm.php

示例2: file

 /**
  * Create a Boostrap file upload button.
  *
  * @param  string  $name
  * @param  string  $label
  * @param  array   $options
  * @return string
  */
 public function file($name, $label = null, array $options = [], $extra = null)
 {
     $label = $this->getLabelTitle($label, $name);
     $options = array_merge(['class' => 'filestyle', 'data-buttonBefore' => 'true'], $options);
     $options = $this->getFieldOptions($options, $name);
     $inputElement = $this->form->input('file', $name, null, $options);
     $wrapperOptions = $this->isHorizontal() ? ['class' => $this->getRightColumnClass()] : [];
     $wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . '</div>';
     return $this->getFormGroupWithLabel($name, $label, $wrapperElement, $extra);
 }
開發者ID:jor3l,項目名稱:bootstrap-form,代碼行數:18,代碼來源:BootstrapForm.php

示例3: file

 /**
  * Create a Boostrap file upload button.
  *
  * @param  string  $name
  * @param  string  $label
  * @param  array   $options
  * @return string
  */
 public function file($name, $label = null, array $options = [])
 {
     $label = $this->getLabelTitle($label, $name);
     $options = array_merge(['class' => 'filestyle', 'data-buttonBefore' => 'true'], $options);
     $options = $this->getFieldOptions($options);
     $wrapperOptions = [];
     if ($this->getType() === Type::HORIZONTAL) {
         $wrapperOptions = ['class' => $this->getRightColumnClass()];
     }
     $inputElement = $this->form->input('file', $name, null, $options);
     $groupElement = '<div ' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . '</div>';
     return $this->getFormGroupWithLabel($name, $label, $groupElement);
 }
開發者ID:jeylabs,項目名稱:larastrap,代碼行數:21,代碼來源:BootstrapForm.php

示例4: buildControl

 /**
  * Build all control with the css class, label, and input.
  *
  * @param       $type
  * @param       $name
  * @param null  $value
  * @param array $attributes
  * @param array $options
  * @return string
  */
 public function buildControl($type, $name, $value = null, $attributes = [], $options = [])
 {
     switch ($type) {
         case 'select':
             $options = ['' => config('field-builder.select')] + $options;
             return $this->form->select($name, $options, $value, $attributes);
         case 'password':
             return $this->form->password($name, $attributes);
         case 'checkbox':
             return $this->form->checkbox($name, $value, isset($attributes['checked']), $attributes);
         case 'textarea':
             return $this->form->textarea($name, $value, $attributes);
         case 'number':
             return $this->form->number($name, $value, $attributes);
         case 'radio':
             return $this->form->radio($name, $value, $attributes);
         case 'email':
             return $this->form->email($name, $value, $attributes);
         default:
             return $this->form->input($type, $name, $value, $attributes);
     }
 }
開發者ID:socieboy,項目名稱:forms,代碼行數:32,代碼來源:FieldBuilder.php

示例5: input

 /**
  * Create a form input field.
  *
  * @param string $type
  * @param string $name
  * @param string $value
  * @param array $options
  * @return string 
  * @static 
  */
 public static function input($type, $name, $value = null, $options = array())
 {
     return \Collective\Html\FormBuilder::input($type, $name, $value, $options);
 }
開發者ID:alvarobfdev,項目名稱:BaseCRUDproject,代碼行數:14,代碼來源:_ide_helper.php

示例6: checkable

 /**
  * Create a checkable input field.
  *
  * @param  string $type
  * @param  string $name
  * @param  mixed  $value
  * @param  bool   $checked
  * @param  array  $options
  *
  * @return string
  */
 protected function checkable($type, $name, $value, $checked, $options)
 {
     $checked = $this->getCheckedState($type, $name, $value, $checked);
     if ($checked) {
         $options['checked'] = 'checked';
     }
     return parent::input($type, $name, $value, $options);
 }
開發者ID:drickferreira,項目名稱:enhanced-bootstrap-forms,代碼行數:19,代碼來源:FormBuilder.php

示例7: input

 /**
  * Create a form input field.
  *
  * @param  string $type
  * @param  string $name
  * @param  string $value
  * @param  array $options
  * @return string
  */
 public function input($type, $name, $value = null, $options = [])
 {
     return parent::input($type, $name, $value, $this->appendErrors($name, $options));
 }
開發者ID:timothyvictor,項目名稱:laravel5-foundation,代碼行數:13,代碼來源:FoundationFiveFormBuilder.php

示例8: input

 /**
  * @see Collective\Html\FormBuilder
  */
 public function input($type, $name, $value = null, $options = [])
 {
     $options = $this->converter->convert(Helper::getFormAttribute($name)) + $options;
     return parent::input($type, $name, $value, $options);
 }
開發者ID:laravel-ardent,項目名稱:laravalid,代碼行數:8,代碼來源:FormBuilder.php

示例9: inputSet

 public function inputSet($type, $name, $value = null, $options = [], $customInput = null)
 {
     $options = $this->converter->convert(Helper::getFormAttribute($name)) + $options;
     $labelText = isset($options['label']) ? $options['label'] : null;
     $requiredLabel = isset($options['data-rule-required']) ? self::$requiredLabel : '';
     $label = self::label($name, $labelText, [], $requiredLabel);
     $input = isset($customInput) ? $customInput : parent::input($type, $name, $value, $options);
     return self::makeSet($label, $input);
 }
開發者ID:PaulSpr,項目名稱:laravalid,代碼行數:9,代碼來源:FormBuilder.php

示例10: color

 /**
  * Creates a color element
  *
  * @param string $name The name of the element
  * @param null   $value
  * @param array  $attributes
  * @return string
  */
 public function color($name, $value = null, $attributes = array())
 {
     $attributes['class'] = isset($attributes['class']) ? self::FORM_CONTROL . ' ' . $attributes['class'] : self::FORM_CONTROL;
     return parent::input('color', $name, $value, $attributes);
 }
開發者ID:JaapMoolenaar,項目名稱:bootstrapper,代碼行數:13,代碼來源:Form.php


注:本文中的Collective\Html\FormBuilder::input方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。