https://src.bluestatic.org
/
hoplite.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f63bef7
)
Add hoplite\views\Inject()
author
Robert Sesek <rsesek@bluestatic.org>
Sun, 14 Aug 2011 17:45:48 +0000
(13:45 -0400)
committer
Robert Sesek <rsesek@bluestatic.org>
Sun, 14 Aug 2011 17:45:48 +0000
(13:45 -0400)
views/template.php
patch
|
blob
|
history
diff --git
a/views/template.php
b/views/template.php
index 8814f19c51e4fe544aadd220a502b68d88910ac7..bb188909d93fb12d17880ac9b9602dc3b29e8449 100644
(file)
--- a/
views/template.php
+++ b/
views/template.php
@@
-18,11
+18,21
@@
namespace hoplite\views;
require_once HOPLITE_ROOT . '/base/filter.php';
require_once HOPLITE_ROOT . '/base/filter.php';
+/*
+ Renders a template with additional vars.
+ @param string The template name to render
+ @param array Variables with which to render.
+*/
+function Inject($name, $vars = array())
+{
+ echo TemplateLoader::Fetch($name)->Render($vars);
+}
+
/*!
/*!
- A Template is initialized with a text file (typically HTML) and can render it
- with data from some model. It has a short macro expansion system, equivalent
- to PHP short open tags, but usable on all installations. Template caching of
- the parsed state is available.
+
A Template is initialized with a text file (typically HTML) and can render it
+
with data from some model. It has a short macro expansion system, equivalent
+
to PHP short open tags, but usable on all installations. Template caching of
+
the parsed state is available.
*/
class Template
{
*/
class Template
{