Make icons clickable in menus
This commit is contained in:
@@ -47,6 +47,29 @@ class UrlHelper extends Base
|
||||
return $this->link($html, $controller, $action, $params, false, $class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Link element with icon
|
||||
*
|
||||
* @access public
|
||||
* @param string $icon Icon name
|
||||
* @param string $label Link label
|
||||
* @param string $controller Controller name
|
||||
* @param string $action Action name
|
||||
* @param array $params Url parameters
|
||||
* @param boolean $csrf Add a CSRF token
|
||||
* @param string $class CSS class attribute
|
||||
* @param string $title Link title
|
||||
* @param boolean $newTab Open the link in a new tab
|
||||
* @param string $anchor Link Anchor
|
||||
* @param bool $absolute
|
||||
* @return string
|
||||
*/
|
||||
public function icon($icon, $label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $newTab = false, $anchor = '', $absolute = false)
|
||||
{
|
||||
$html = '<i class="fa fa-fw fa-'.$icon.'" aria-hidden="true"></i>'.$label;
|
||||
return $this->helper->url->link($html, $controller, $action, $params, $csrf, $class, $title, $newTab, $anchor, $absolute);
|
||||
}
|
||||
|
||||
/**
|
||||
* Link element
|
||||
*
|
||||
@@ -58,14 +81,14 @@ class UrlHelper extends Base
|
||||
* @param boolean $csrf Add a CSRF token
|
||||
* @param string $class CSS class attribute
|
||||
* @param string $title Link title
|
||||
* @param boolean $new_tab Open the link in a new tab
|
||||
* @param boolean $newTab Open the link in a new tab
|
||||
* @param string $anchor Link Anchor
|
||||
* @param bool $absolute
|
||||
* @return string
|
||||
*/
|
||||
public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '', $absolute = false)
|
||||
public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $newTab = false, $anchor = '', $absolute = false)
|
||||
{
|
||||
return '<a href="'.$this->href($controller, $action, $params, $csrf, $anchor, $absolute).'" class="'.$class.'" title=\''.$title.'\' '.($new_tab ? 'target="_blank"' : '').'>'.$label.'</a>';
|
||||
return '<a href="'.$this->href($controller, $action, $params, $csrf, $anchor, $absolute).'" class="'.$class.'" title=\''.$title.'\' '.($newTab ? 'target="_blank"' : '').'>'.$label.'</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user