From 47db7e6a0bccd63c3f2063818ff22b491fed3178 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 27 Oct 2023 16:06:48 +0900 Subject: [PATCH] Add template variables for backward compatibility --- common/framework/Template.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/framework/Template.php b/common/framework/Template.php index a38fe95d2..148ecf5ed 100644 --- a/common/framework/Template.php +++ b/common/framework/Template.php @@ -37,6 +37,12 @@ class Template public $cache_enabled = true; public $cache_path; + /** + * Properties for backward compatibility + */ + public $path; + public $web_path; + /** * Properties for state management during compilation/execution */ @@ -177,6 +183,8 @@ class Template $this->config->autoescape = true; } $this->source_type = preg_match('!^((?:m\.)?[a-z]+)/!', $this->relative_dirname, $match) ? $match[1] : null; + $this->path = $this->absolute_dirname; + $this->web_path = \RX_BASEURL . $this->relative_dirname; $this->_setCachePath(); } @@ -439,6 +447,7 @@ class Template { // Import Context and lang as local variables. $__Context = $this->vars ?: \Context::getAll(); + $__Context->tpl_path = $this->absolute_dirname; // Start the output buffer. $this->_ob_level = ob_get_level();