Pass App class instace to all templates via "$APP" variable
This commit is contained in:
parent
f0912d6219
commit
9fcd74f470
|
@ -61,6 +61,8 @@ class FriendicaSmartyEngine implements ITemplateEngine {
|
||||||
$s = new FriendicaSmarty();
|
$s = new FriendicaSmarty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$r['$APP'] = get_app();
|
||||||
|
|
||||||
// "middleware": inject variables into templates
|
// "middleware": inject variables into templates
|
||||||
$arr = array(
|
$arr = array(
|
||||||
"template"=> basename($s->filename),
|
"template"=> basename($s->filename),
|
||||||
|
|
|
@ -22,7 +22,7 @@ function replace_macros($s,$r) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
// pass $baseurl to all templates
|
// pass $baseurl to all templates
|
||||||
$r['$baseurl'] = z_root();
|
$r['$baseurl'] = $a->get_baseurl();
|
||||||
|
|
||||||
|
|
||||||
$t = $a->template_engine();
|
$t = $a->template_engine();
|
||||||
|
|
Loading…
Reference in a new issue