From: Fabrixxm Date: Wed, 3 Feb 2016 13:01:37 +0000 (+0100) Subject: Pass App class instace to all templates via "$APP" variable X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9fcd74f470f596fb85727af561d86404b59dfc93;p=friendica.git Pass App class instace to all templates via "$APP" variable --- diff --git a/include/friendica_smarty.php b/include/friendica_smarty.php index 99dc12bf8d..9ba2d2a744 100644 --- a/include/friendica_smarty.php +++ b/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( diff --git a/include/text.php b/include/text.php index 4f3af5aee8..c7681a4d58 100644 --- a/include/text.php +++ b/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();