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


PHP FormBuilder::text方法代码示例

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


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

 /**
  * Create a submit button with default classes
  *
  * @param null $value
  * @param array $options
  * @return string
  */
 public function getFormGroupText($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::text('' . $id . '', $value, ['class' => 'form-control']) . "\n                " . $feedBackHtml . "\n            </div>";
     return $retval;
 }
开发者ID:wi-development,项目名称:my-framework,代码行数:14,代码来源:FormBuilder.php

示例3: text

 public function text($name, $value = null, $options = [])
 {
     return sprintf('
     <div class="input-field col l6 s8 offset-l3 offset-s2">
         %s
         %s
     </div>', parent::text($name, $value, $options), parent::label($name, null, []));
 }
开发者ID:gitter-badger,项目名称:scaffolder-theme-material,代码行数:8,代码来源:MaterialThemeForm.php

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

示例5: text

 /**
  * Create a text input field.
  *
  * @param string $name
  * @param string $value
  * @param array $options
  * @return string 
  * @static 
  */
 public static function text($name, $value = null, $options = array())
 {
     return \Collective\Html\FormBuilder::text($name, $value, $options);
 }
开发者ID:alvarobfdev,项目名称:BaseCRUDproject,代码行数:13,代码来源:_ide_helper.php

示例6: wrappedText

 /**
  * @param $name
  * @param $labelText
  * @param null $value
  * @param array $options
  * @return string
  */
 public function wrappedText($name, $labelText, $value = null, $options = [])
 {
     return $this->wrapWithLabel($name, $labelText, $options, parent::text($name, $value, $this->appendErrors($name, $options)));
 }
开发者ID:timothyvictor,项目名称:laravel5-foundation,代码行数:11,代码来源:FoundationFiveFormBuilder.php

示例7: postalcode

 public function postalcode($name, $value = null, $options = [])
 {
     if (isset($options['class'])) {
         $options['class'] .= ' postalcodeNL';
     } else {
         $options['class'] = 'postalcodeNL';
     }
     $options = $this->converter->convert(Helper::getFormAttribute($name)) + $options;
     return parent::text($name, $value, $options);
 }
开发者ID:PaulSpr,项目名称:laravalid,代码行数:10,代码来源:FormBuilder.php

示例8: text

 public function text($name, $value = null, $options = [])
 {
     $options = $this->setOptionClasses($name, $options, ['form-control']);
     $controlOptions = array_filter($options, function ($key) {
         return $key !== 'label';
     }, ARRAY_FILTER_USE_KEY);
     $controlHtml = parent::text($name, $value, $controlOptions);
     return $this->renderControl('text', $controlHtml, $name, $value, $options);
 }
开发者ID:genealabs,项目名称:laravel-casts,代码行数:9,代码来源:FormBuilder.php

示例9: text

 /**
  * {@inheritdoc}
  * @param string      $name       The name of the text input
  * @param string|null $value      The default value
  * @param array       $attributes The attributes of the input
  * @return string
  */
 public function text($name, $value = null, $attributes = array())
 {
     $attributes['class'] = isset($attributes['class']) ? self::FORM_CONTROL . ' ' . $attributes['class'] : self::FORM_CONTROL;
     return parent::text($name, $value, $attributes);
 }
开发者ID:JaapMoolenaar,项目名称:bootstrapper,代码行数:12,代码来源:Form.php

示例10: text

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

示例11: old

    $addon .= '<span class="fa fa-' . $content . '"></span>';
    $addon .= "</span>";
    $element = Form::text($name, $value ? $value : old($name), field_attributes($name, $attributes));
    $out = '<div class="input-group">';
    $out .= $end ? '' : $addon;
    $out .= $element;
    $out .= $end ? $addon : '';
    $out .= '</div>';
    return field_wrapper($name, $label, $out);
});
Form::macro('textFieldIconClean', function ($name, $label = NULL, $content = 'pencil', $end = false, array $attributes = [], $value = NULL) {
    $addon = '<span class="input-group-addon">';
    $addon .= '<span class="fa fa-' . $content . '"></span>';
    $addon .= "</span>";
    $attributes = array_merge($attributes, ['placeholder' => $label]);
    $element = Form::text($name, $value ? $value : old($name), field_attributes($name, $attributes));
    $out = '<div class="input-group">';
    $out .= $end ? '' : $addon;
    $out .= $element;
    $out .= $end ? $addon : '';
    $out .= '</div>';
    return field_wrapper($name, $out, '');
});
Form::macro('emailFieldIcon', function ($name, $label, $content = 'envelope', $end = false, array $attributes = [], $value = NULL) {
    $addon = '<span class="input-group-addon">';
    $addon .= '<span class="fa fa-' . $content . '"></span>';
    $addon .= "</span>";
    $element = Form::email($name, $value ? $value : old($name), field_attributes($name, $attributes));
    $out = '<div class="input-group">';
    $out .= $end ? '' : $addon;
    $out .= $element;
开发者ID:brunoti,项目名称:html-macros,代码行数:31,代码来源:macros.php


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