lithium\template\helper\Form::button PHP Method

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.
    public function button($title = null, array $options = array())
    {
        $defaults = array('escape' => true);
        list($scope, $options) = $this->_options($defaults, $options);
        list($title, $options, $template) = $this->_defaults(__METHOD__, $title, $options);
        $arguments = compact('type', 'title', 'options', 'value');
        return $this->_render(__METHOD__, 'button', $arguments, $scope);
    }

Usage Example

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