button() public method

Generates an HTML button .
public button ( string $title = null, array $options = [] ) : string
$title string The title of the button.
$options array Any options passed are converted to HTML attributes within the `` tag.
return string Returns a `` tag with the given title and HTML attributes.
示例#1
0
 public function button($title = null, array $options = array())
 {
     if (isset($options['icon'])) {
         $icon = $options['icon'];
         $title = sprintf('<i class="fa fa-%s"></i> %s', $icon, $title);
         $options['escape'] = false;
     }
     return parent::button($title, $options);
 }