summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-19 18:04:22 -0400
committerFrederic Guillot <fred@kanboard.net>2016-03-19 18:04:22 -0400
commit1ad57c74732e4463cfa5051e975c54f4e65d7e09 (patch)
tree80870017404b15da538353bd5dd52d76b8482ca2 /app/Helper
parent42376aec4ad78ad880d3e42219ccec07bf09339a (diff)
Add buttons in project overview sections
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/UrlHelper.php35
1 files changed, 27 insertions, 8 deletions
diff --git a/app/Helper/UrlHelper.php b/app/Helper/UrlHelper.php
index cad9fdef..095c4af4 100644
--- a/app/Helper/UrlHelper.php
+++ b/app/Helper/UrlHelper.php
@@ -29,18 +29,37 @@ class UrlHelper extends Base
}
/**
- * HTML Link tag
+ * Button Link Element
*
* @access public
- * @param string $label Link label
+ * @param string $icon Font-Awesome icon
+ * @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 $action Action name
+ * @param array $params Url parameters
+ * @param string $class CSS class attribute
+ * @return string
+ */
+ public function button($icon, $label, $controller, $action, array $params = array(), $class = '')
+ {
+ $icon = '<i class="fa '.$icon.' fa-fw"></i> ';
+ $class = 'btn '.$class;
+ return $this->link($icon.$label, $controller, $action, $params, false, $class);
+ }
+
+ /**
+ * Link element
+ *
+ * @access public
+ * @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
- * @param boolean $new_tab Open the link in a new tab
- * @param string $anchor Link Anchor
+ * @param boolean $new_tab Open the link in a new tab
+ * @param string $anchor Link Anchor
* @return string
*/
public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '')