Bootstrapper\Form::feedback PHP Méthode

feedback() public méthode

Creates a feedback block with an icon
public feedback ( string $label, string $input, string $icon, array $attributes = [] ) : string
$label string The label
$input string The input
$icon string The icon
$attributes array The attributes of the block
Résultat string
    public function feedback($label, $input, $icon, $attributes = [])
    {
        $attributes['class'] = isset($attributes['class']) ? 'form-group has-feedback ' . $attributes['class'] : 'form-group has-feedback';
        $attributes = new Attributes($attributes);
        $icon = "<span class='glyphicon glyphicon-{$icon} form-control-feedback'></span>";
        return "<div {$attributes}>{$label}{$input}{$icon}</div>";
    }

Usage Example

Exemple #1
0
 /**
  * Creates a feedback block with an icon
  *
  * @param string $label The label
  * @param string $input The input
  * @param string $icon The icon
  * @param array $attributes The attributes of the block
  * @return string 
  * @static 
  */
 public static function feedback($label, $input, $icon, $attributes = array())
 {
     return \Bootstrapper\Form::feedback($label, $input, $icon, $attributes);
 }