Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/View/Helper/BootstrapHtmlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,32 @@ public function __construct (\Cake\View\View $view, array $config = []) {
* @param $icon Name of the icon.
*
**/
public function icon ($icon) {
return $this->_useFontAwesome ? $this->faIcon($icon) : $this->glIcon($icon);
public function icon ($icon, $options = array()) {
return $this->_useFontAwesome ? $this->faIcon($icon, $options) : $this->glIcon($icon, $options);
}

/**
* Create a font awesome icon.
*
* @param $icon Name of the icon.
*/
public function faIcon ($icon) {
return '<i class="fa fa-'.$icon.'"></i>' ;
public function faIcon ($icon, $options = array()) {
$options = $this->addClass($options, 'fa');
$options = $this->addClass($options, 'fa-'.$icon);

return $this->tag('i', '', $options);
}

/**
* Create a glyphicon icon.
*
* @param $icon Name of the icon.
*/
public function glIcon ($icon) {
return '<i class="glyphicon glyphicon-'.$icon.'"></i>';
public function glIcon ($icon, $options = array()) {
$options = $this->addClass($options, 'glyphicon');
$options = $this->addClass($options, 'glyphicon-'.$icon);

return $this->tag('i', '', $options);
}

/**
Expand Down