summaryrefslogtreecommitdiffstats
path: root/inc/render.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2013-10-16 19:34:08 +0200
committerSimon Rettberg2013-10-16 19:34:08 +0200
commite74e32a0eb4b2bb9691a079d6dc579925d7bb0ce (patch)
tree01f686385bab29fe14b13a819fdbb87ba6ea1100 /inc/render.inc.php
parentAdd simple menu bar (diff)
downloadslx-admin-e74e32a0eb4b2bb9691a079d6dc579925d7bb0ce.tar.gz
slx-admin-e74e32a0eb4b2bb9691a079d6dc579925d7bb0ce.tar.xz
slx-admin-e74e32a0eb4b2bb9691a079d6dc579925d7bb0ce.zip
New stuff
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)