summaryrefslogtreecommitdiffstats
path: root/inc/render.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/render.inc.php')
-rw-r--r--inc/render.inc.php22
1 files changed, 20 insertions, 2 deletions
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
,
' </head>
<body>
+ <div class="container">
',
self::$body
,
- ' <script src="script/jquery.js"></script>
+ ' </div>
+ <script src="script/jquery.js"></script>
<script src="script/bootstrap.min.js"></script></body>
</html>'
;
@@ -74,12 +76,28 @@ 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
*/
public static function openTag($tag, $params = false)