-
Notifications
You must be signed in to change notification settings - Fork 23
/
MyUrlHelper.php
38 lines (34 loc) · 1.21 KB
/
MyUrlHelper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Kanboard\Plugin\Greenwing;
use Kanboard\Core\Base;
/**
* Url Helper
*
* @package helper
* @author Frederic Guillot
*/
class MyUrlHelper extends Base
{
/**
* 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><span>'.$label.'</span>';
return $this->helper->url->link($html, $controller, $action, $params, $csrf, $class, $title, $newTab, $anchor, $absolute);
}
}