summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-04 20:26:52 -0500
committerFrederic Guillot <fred@kanboard.net>2016-03-04 20:26:52 -0500
commit38082096909424c23032224365c90aa5189eb6f0 (patch)
treebdc35680cccc8d73b4eb6e9d9159889785388ee0 /app
parent8f3e2b2e5c62a6130f6c8867ab335fb4c1a32c5c (diff)
Move Template::layout() to LayoutHelper
Diffstat (limited to 'app')
-rw-r--r--app/Core/Template.php17
-rw-r--r--app/Helper/LayoutHelper.php23
2 files changed, 20 insertions, 20 deletions
diff --git a/app/Core/Template.php b/app/Core/Template.php
index fa7b65ec..f85c7f28 100644
--- a/app/Core/Template.php
+++ b/app/Core/Template.php
@@ -70,23 +70,6 @@ class Template
}
/**
- * Render a page layout
- *
- * @access public
- * @param string $template_name Template name
- * @param array $template_args Key/value map
- * @param string $layout_name Layout name
- * @return string
- */
- public function layout($template_name, array $template_args = array(), $layout_name = 'layout')
- {
- return $this->render(
- $layout_name,
- $template_args + array('content_for_layout' => $this->render($template_name, $template_args))
- );
- }
-
- /**
* Define a new template override
*
* @access public
diff --git a/app/Helper/LayoutHelper.php b/app/Helper/LayoutHelper.php
index 064c11ac..dc90b7f3 100644
--- a/app/Helper/LayoutHelper.php
+++ b/app/Helper/LayoutHelper.php
@@ -5,7 +5,7 @@ namespace Kanboard\Helper;
use Kanboard\Core\Base;
/**
- * Layout helpers
+ * Layout Helper
*
* @package helper
* @author Frederic Guillot
@@ -30,7 +30,7 @@ class LayoutHelper extends Base
$params['board_selector'] = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId());
}
- return $this->template->layout($template, $params);
+ return $this->pageLayout($template, $params);
}
/**
@@ -146,7 +146,24 @@ class LayoutHelper extends Base
}
/**
- * Common method to generate a sublayout
+ * Render page layout
+ *
+ * @access public
+ * @param string $template Template name
+ * @param array $params Key/value dictionary
+ * @param string $layout Layout name
+ * @return string
+ */
+ public function pageLayout($template, array $params = array(), $layout = 'layout')
+ {
+ return $this->template->render(
+ $layout,
+ $params + array('content_for_layout' => $this->template->render($template, $params))
+ );
+ }
+
+ /**
+ * Common method to generate a sub-layout
*
* @access public
* @param string $sublayout