Browse Source

Pass App class instace to all templates via "$APP" variable

pull/2312/head
Fabrixxm 6 years ago
parent
commit
9fcd74f470
  1. 2
      include/friendica_smarty.php
  2. 2
      include/text.php

2
include/friendica_smarty.php

@ -60,6 +60,8 @@ class FriendicaSmartyEngine implements ITemplateEngine {
$template = $s;
$s = new FriendicaSmarty();
}
$r['$APP'] = get_app();
// "middleware": inject variables into templates
$arr = array(

2
include/text.php

@ -22,7 +22,7 @@ function replace_macros($s,$r) {
$a = get_app();
// pass $baseurl to all templates
$r['$baseurl'] = z_root();
$r['$baseurl'] = $a->get_baseurl();
$t = $a->template_engine();

Loading…
Cancel
Save