public function button($value = null, $options = array())
 {
     if (strpos(@$options['class'], 'btn') === false) {
         @($options['class'] .= ' btn btn-default');
     }
     return parent::password($value, $options);
 }
Esempio n. 2
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);
 }
Esempio n. 3
0
 /**
  * Create the input group for an element with the correct classes for errors.
  *
  * @param  string $type
  * @param  string $name
  * @param  string $value
  * @param  array $options
  * @return string
  */
 public function input($type, $name, $value = null, $options = [])
 {
     $label = array_get($options, 'label', $this->translationDomain ? $this->translationDomain . '.' . $name : $name);
     unset($options['label']);
     $options = $this->getFieldOptions($options);
     $wrapperOptions = ['class' => $this->getRightColumnClass()];
     $description = '';
     if (isset($options['description'])) {
         $description = '<span class="help-block">' . $options['description'] . '</span>';
         unset($options['description']);
     }
     $prepend = '';
     if (isset($options['prepend'])) {
         $prepend = '<span class="input-group-addon">' . $options['prepend'] . '</span>';
         unset($options['prepend']);
         $wrapperOptions['class'] = $wrapperOptions['class'] . ' input-group';
     }
     $append = '';
     if (isset($options['append'])) {
         $append = '<span class="input-group-addon">' . $options['append'] . '</span>';
         unset($options['append']);
         $wrapperOptions['class'] = $wrapperOptions['class'] . ' input-group';
     }
     $inputElement = $type == 'password' ? $this->form->password($name, $options) : $this->form->{$type}($name, $value, $options);
     $groupElement = '<div ' . $this->html->attributes($wrapperOptions) . '>' . $prepend . $inputElement . $append . '</div>';
     $groupElement .= $this->getFieldError($name);
     return $this->getFormGroup($name, $label, $description . $groupElement);
 }
 /**
  * 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, $options = array())
 {
     $label = $this->getLabelTitle($label, $name);
     $options = $this->getFieldOptions($options);
     $wrapperOptions = array('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->getFormGroup($name, $label, $groupElement);
 }
Esempio n. 5
0
 /**
  * Create a password input field.
  *
  * @param string $name
  * @param array $options
  * @return string 
  * @static 
  */
 public static function password($name, $options = array())
 {
     return \Illuminate\Html\FormBuilder::password($name, $options);
 }
Esempio n. 6
0
 /**
  * Create a HTML password input element.
  *
  * @param  string  $name
  * @param  string  $label
  * @param  array   $attributes
  * @return string
  */
 public function password($name, $label = '', $attributes = array())
 {
     $attributes = $this->setAttributes($name, $attributes);
     $field = parent::password($name, $attributes);
     return $this->buildWrapper($field, $name, $label);
 }
Esempio n. 7
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);
 }
 /**
  * @param Field $field
  * @return string
  */
 public function passwordField(Field $field)
 {
     return $this->builder->password($field->name, $field->getAttributes());
 }
Esempio n. 9
0
 /**
  * Create a password input field.
  *
  * @param  string  $name
  * @param  array   $options
  * @return string
  */
 public function password($name, $options = array())
 {
     return parent::password($name, $this->addClass($options, static::TEXT_INPUT_CLASS));
 }