mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Add template variables for backward compatibility
This commit is contained in:
parent
dbcbb57413
commit
47db7e6a0b
1 changed files with 9 additions and 0 deletions
|
|
@ -37,6 +37,12 @@ class Template
|
||||||
public $cache_enabled = true;
|
public $cache_enabled = true;
|
||||||
public $cache_path;
|
public $cache_path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Properties for backward compatibility
|
||||||
|
*/
|
||||||
|
public $path;
|
||||||
|
public $web_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Properties for state management during compilation/execution
|
* Properties for state management during compilation/execution
|
||||||
*/
|
*/
|
||||||
|
|
@ -177,6 +183,8 @@ class Template
|
||||||
$this->config->autoescape = true;
|
$this->config->autoescape = true;
|
||||||
}
|
}
|
||||||
$this->source_type = preg_match('!^((?:m\.)?[a-z]+)/!', $this->relative_dirname, $match) ? $match[1] : null;
|
$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();
|
$this->_setCachePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -439,6 +447,7 @@ class Template
|
||||||
{
|
{
|
||||||
// Import Context and lang as local variables.
|
// Import Context and lang as local variables.
|
||||||
$__Context = $this->vars ?: \Context::getAll();
|
$__Context = $this->vars ?: \Context::getAll();
|
||||||
|
$__Context->tpl_path = $this->absolute_dirname;
|
||||||
|
|
||||||
// Start the output buffer.
|
// Start the output buffer.
|
||||||
$this->_ob_level = ob_get_level();
|
$this->_ob_level = ob_get_level();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue