password() public method

Create a password input field.
public password ( string $name, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$options array
return Illuminate\Support\HtmlString
Exemplo n.º 1
0
 /**
  * Create a password input field.
  *
  * @param  string  $name
  * @param  array   $options
  *
  * @return string
  */
 public function password($name, $options = [])
 {
     $this->addErrorClass($name, $options);
     $tags['input'] = parent::password($name, $options);
     $tags['error'] = $this->getErrorTag($name);
     return $this->buildTags($tags);
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 /**
  * Create the input group for an element with the correct classes for errors.
  *
  * @param  string  $type
  * @param  string  $name
  * @param  string  $label
  * @param  string  $value
  * @param  array   $options
  * @return string
  */
 public function input($type, $name, $label = null, $value = null, array $options = [], $extra = null)
 {
     $label = $label === false ? $label : $this->getLabelTitle($label, $name);
     $options = $this->getFieldOptions($options, $name);
     $inputElement = $type === 'password' ? $this->form->password($name, $options) : $this->form->{$type}($name, $value, $options);
     $wrapperOptions = $this->isHorizontal() ? ['class' => $this->getRightColumnClass()] : [];
     $wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . '</div>';
     return $label ? $this->getFormGroupWithLabel($name, $label, $wrapperElement, $extra) : $this->getFormGroup($name, $wrapperElement, $extra);
 }
Exemplo n.º 4
0
 /**
  * Create the input group for an element with the correct classes for errors.
  *
  * @param  string  $type
  * @param  string  $name
  * @param  string  $label
  * @param  string  $value
  * @param  array   $options
  * @return string
  */
 public function input($type, $name, $label = null, $value = null, array $options = [])
 {
     $label = $this->getLabelTitle($label, $name);
     $options = $this->getFieldOptions($options);
     $wrapperOptions = [];
     if ($this->getType() === Type::HORIZONTAL) {
         $wrapperOptions = ['class' => $this->getRightColumnClass()];
     }
     $inputElement = $type == 'password' ? $this->form->password($name, $options) : $this->form->{$type}($name, $value, $options);
     $groupElement = '<div ' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . '</div>';
     return $this->getFormGroupWithLabel($name, $label, $groupElement);
 }
Exemplo n.º 5
0
 /**
  * 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);
     }
 }
Exemplo n.º 6
0
 /**
  * Create a password input field.
  *
  * @param string $name
  * @param array $options
  * @return string 
  * @static 
  */
 public static function password($name, $options = array())
 {
     return \Collective\Html\FormBuilder::password($name, $options);
 }
Exemplo n.º 7
0
 public function password($name, $options = [])
 {
     $options = $this->setOptionClasses($name, $options, ['form-control']);
     $controlOptions = $this->getControlOptions(collect($options));
     $controlHtml = parent::password($name, $controlOptions->toArray());
     return $this->renderControl('password', $controlHtml, $name, '', $options);
 }
Exemplo n.º 8
0
 /**
  * {@inheritdoc}
  * @param string $name       The name of the password input
  * @param array  $attributes The attributes of the input
  * @return string
  */
 public function password($name, $attributes = array())
 {
     $attributes['class'] = isset($attributes['class']) ? self::FORM_CONTROL . ' ' . $attributes['class'] : self::FORM_CONTROL;
     return parent::password($name, $attributes);
 }
Exemplo n.º 9
0
    $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;
    $out .= $end ? $addon : '';
    $out .= '</div>';
    return field_wrapper($name, $label, $out);
});
Form::macro('passwordFieldIconClean', function ($name, $label = NULL, $content = 'lock', $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::password($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, '');
});
HTML::macro('modal', function ($id, $title, $msg, $confirm = 'Sim', $close = 'Fechar') {
    $out = '<div class="modal fade" id="' . $id . '">
        <div class="modal-dialog modal-sm">
        <div class="modal-content">
        <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">' . $title . '</h4>
        </div>