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


PHP FormBuilder::label方法代碼示例

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


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

示例1: textfield

 public function textfield($name, $label, $errors, $labelOptions = array(), $inputOptions = array())
 {
     $labelOptions['class'] = 'form-label';
     $inputOptions['class'] = 'form-control';
     $inputOptions['placeholder'] = $label;
     return sprintf('<div class="form-group">%s<div%s>%s%s</div></div><!-- end form-group -->', parent::label($name, $label, $labelOptions), $errors->has($name) ? ' class="error-control"' : '', parent::text($name, null, $inputOptions), $errors->has($name) ? '<span class="error"><label class="error" for="' . $name . '">' . $errors->first($name) . '</label></span>' : '');
 }
開發者ID:hungkhanh0709,項目名稱:PhuongLoiFashion,代碼行數:7,代碼來源:FormBuilder.php

示例2: getFormGroupPassword

 public function getFormGroupPassword($label, $id, $value, $errors)
 {
     $feedBackSelector = $this->getFeedBackSelector($errors, $id);
     $feedBackHtml = $this->getFeedBackHtml($errors, $id);
     $retval = "<div class=\"form-group  " . $feedBackSelector . "\">\n                " . parent::label('' . $id . '', '' . $label . ':', ['class' => 'control-label']) . "\n                " . parent::password('' . $id . '', ['class' => 'form-control']) . "\n                " . $feedBackHtml . "\n            </div>";
     return $retval;
 }
開發者ID:wi-development,項目名稱:my-framework,代碼行數:7,代碼來源:FormBuilder.php

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

示例4: textarea

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

示例5: wrapField

 protected function wrapField($field, $labelName, $fieldOptions)
 {
     $labelText = isset($fieldOptions['label']) ? $fieldOptions['label'] : null;
     //making sure that we match field's ID even when it is custom
     $labelName = isset($field['id']) ? $fieldOptions['id'] : $labelName;
     return sprintf('
     <div class="input-field col l3 m4 s8 offset-l2 offset-m1 offset-s2">
         %s
         %s
     </div>', $field, parent::label($labelName, $labelText, []));
 }
開發者ID:IQ-RIA,項目名稱:scaffolder-theme-material,代碼行數:11,代碼來源:MaterialThemeForm.php

示例6: registerFormTextField

 private function registerFormTextField()
 {
     FormBuilder::macro('textField', function ($type, $name, $errors, $label, $labelOptions = array(), $inputOptions = array(), $inputClass) {
         $valeur = \Request::old($name) ? \Request::old($name) : null;
         $inputOptions['class'] = 'form-control';
         return sprintf('
             <div class="form-group">
                 %s
                 <div class="' . $inputClass . '">
                     %s
                 </div>
             </div>', FormBuilder::label($name, $label, $labelOptions), $type == 'email' ? FormBuilder::email($name, $valeur, $inputOptions) : FormBuilder::text($name, $valeur, $inputOptions), $errors->first($name, '<small class="help-block">:message</small>'));
     });
 }
開發者ID:WizzerOmega,項目名稱:webstock,代碼行數:14,代碼來源:HtmlFormServiceProvider.php

示例7: label

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

示例8: label

 /**
  * Create a Bootstrap label.
  *
  * @param  string $name
  * @param  string $value
  * @param  array  $options
  *
  * @return string
  */
 public function label($name, $value = null, array $options = [])
 {
     $options = $this->getLabelOptions($options);
     return $this->form->label($name, $value, $options);
 }
開發者ID:bnbwebexpertise,項目名稱:laravel-bootstrap-form,代碼行數:14,代碼來源:BootstrapForm.php

示例9: label

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

示例10: label

 /**
  * Create a form label element.
  *
  * @param string $name
  * @param string $value
  * @param array  $options
  * @param bool   $escape_html
  *
  * @return \Illuminate\Support\HtmlString
  * @static
  */
 public static function label($name, $value = null, $options = array(), $escape_html = true)
 {
     return \Collective\Html\FormBuilder::label($name, $value, $options, $escape_html);
 }
開發者ID:Dimimo,項目名稱:Booklet,代碼行數:15,代碼來源:_ide_helper.php

示例11: label

 public function label($name, $label = null, $options = [], $escapeHtml = true)
 {
     $label = array_pull($options, 'label') ?? $label ?? '';
     $options = $this->setLabelOptionClasses($options);
     return parent::label($name, $label, $options, $escapeHtml);
 }
開發者ID:genealabs,項目名稱:laravel-casts,代碼行數:6,代碼來源:FormBuilder.php

示例12: label

 /**
  * {@inheritdoc}
  * @param string      $name    The name of the object this label will be
  *                             attached to
  * @param string|null $value   The text of the label
  * @param array       $options The options of the label
  * @return string
  */
 public function label($name, $value = null, $options = array(), $valueHtml = false)
 {
     $options['class'] = isset($options['class']) ? self::LABEL . ' ' . $options['class'] : self::LABEL;
     return parent::label($name, $value, $options, $valueHtml);
 }
開發者ID:JaapMoolenaar,項目名稱:bootstrapper,代碼行數:13,代碼來源:Form.php

示例13: label

 /**
  * Create a label.
  *
  * @param  string  $name
  * @param  string  $value
  * @param  array   $options
  *
  * @return string
  */
 public function label($name, $value = null, $options = [], $escape_html = true)
 {
     $this->addErrorClass($name, $options);
     return parent::label($name, $value, $options);
 }
開發者ID:nerea91,項目名稱:laravel,代碼行數:14,代碼來源:Foundation.php


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