From e74e32a0eb4b2bb9691a079d6dc579925d7bb0ce Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 16 Oct 2013 19:34:08 +0200 Subject: New stuff --- inc/render.inc.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'inc/render.inc.php') diff --git a/inc/render.inc.php b/inc/render.inc.php index 455fd87d..41b8e2b8 100644 --- a/inc/render.inc.php +++ b/inc/render.inc.php @@ -46,10 +46,12 @@ class Render , ' +
', self::$body , - ' + '
+ ' ; @@ -74,11 +76,27 @@ class Render /** * Add the given template to the output, using the given params for placeholders in the template */ - public static function parse($template, $params) + public static function addTemplate($template, $params = false) { self::$body .= self::$mustache->render(self::getTemplate($template), $params); } + /** + * Add error message to page + */ + public static function addError($message) + { + self::addTemplate('messagebox-error', array('message' => $message)); + } + + /** + * Parse template with given params and return; do not add to body + */ + public static function parse($template, $params = false) + { + return self::$mustache->render(self::getTemplate($template), $params); + } + /** * Open the given html tag, optionally adding the passed assoc array of params */ -- cgit v1.2.3-55-g7522