diff options
| author | uwetews <uwe.tews@googlemail.com> | 2016-02-09 01:15:12 +0100 |
|---|---|---|
| committer | uwetews <uwe.tews@googlemail.com> | 2016-02-09 01:15:12 +0100 |
| commit | c59ca44b9ff62a7f54e30409514834a8529780ca (patch) | |
| tree | d5a4efbcadceb335afd0ce5fa834f36d3abe6bd1 /libs/sysplugins/smarty_internal_templatecompilerbase.php | |
| parent | c1f34b1314e3308c307bd46af91dcb4b09125210 (diff) | |
| download | smarty-c59ca44b9ff62a7f54e30409514834a8529780ca.tar.gz smarty-c59ca44b9ff62a7f54e30409514834a8529780ca.tar.bz2 smarty-c59ca44b9ff62a7f54e30409514834a8529780ca.zip | |
- move some code from parser into compiler
Diffstat (limited to 'libs/sysplugins/smarty_internal_templatecompilerbase.php')
| -rw-r--r-- | libs/sysplugins/smarty_internal_templatecompilerbase.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 5b4312e5..22b7e9ff 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -290,6 +290,13 @@ abstract class Smarty_Internal_TemplateCompilerBase public $_cache = array(); /** + * counter for prefix variable number + * + * @var int + */ + public static $prefixVariableNumber = 0; + + /** * method to compile a Smarty template * * @param mixed $_content template source @@ -1250,4 +1257,34 @@ abstract class Smarty_Internal_TemplateCompilerBase return false; } + /** + * Get new prefix variable name + * + * @return string + */ + public function getNewPrefixVariable() + { + self::$prefixVariableNumber ++; + return $this->getPrefixVariable(); + } + + /** + * Get current prefix variable name + * + * @return string + */ + public function getPrefixVariable() + { + return '$_prefixVariable' . self::$prefixVariableNumber; + } + + /** + * append code to prefix buffer + * + * @param string $code + */ + public function appendPrefixCode($code) + { + $this->prefix_code[] = $code; + } } |
