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


PHP FormBuilder::email方法代码示例

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


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

示例1: email

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

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

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

示例4: email

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

示例5: email

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

示例6: email

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

示例7: old

    $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;
    $out .= $end ? $addon : '';
    $out .= '</div>';
    return field_wrapper($name, $label, $out);
});
Form::macro('emailFieldIconClean', function ($name, $label = NULL, $content = 'envelope', $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::email($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('passwordFieldIcon', function ($name, $label, $content = 'lock', $end = false, array $attributes = [], $value = NULL) {
    $addon = '<span class="input-group-addon">';
    $addon .= '<span class="fa fa-' . $content . '"></span>';
    $addon .= "</span>";
    $element = Form::password($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::email方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。