Bootstrapper\Form::feedback PHP Method

feedback() public method

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
return 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

コード例 #1
0
ファイル: _ide_helper.php プロジェクト: qarlson/infr
 /**
  * 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);
 }