summaryrefslogtreecommitdiff
path: root/app/Helper/AppHelper.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Helper/AppHelper.php')
-rw-r--r--app/Helper/AppHelper.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/app/Helper/AppHelper.php b/app/Helper/AppHelper.php
index 09f280cb..3cefd1c5 100644
--- a/app/Helper/AppHelper.php
+++ b/app/Helper/AppHelper.php
@@ -12,17 +12,34 @@ use Kanboard\Core\Base;
*/
class AppHelper extends Base
{
+ public function isAjax()
+ {
+ return $this->request->isAjax();
+ }
+
+ /**
+ * Render Javascript component
+ *
+ * @param string $name
+ * @param array $params
+ * @return string
+ */
+ public function component($name, array $params = array())
+ {
+ return '<div class="js-'.$name.'" data-params=\''.json_encode($params, JSON_HEX_APOS).'\'></div>';
+ }
+
/**
* Get config variable
*
* @access public
* @param string $param
- * @param mixed $default_value
+ * @param mixed $default
* @return mixed
*/
- public function config($param, $default_value = '')
+ public function config($param, $default = '')
{
- return $this->configModel->get($param, $default_value);
+ return $this->configModel->get($param, $default);
}
/**