From eba9a17c654469e03c758da7ad3db1ca993f5943 Mon Sep 17 00:00:00 2001 From: rojaro <> Date: Wed, 20 Oct 2010 20:28:05 +0000 Subject: fixed #296 --- framework/Web/UI/TTemplateManager.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 6994d665..505600e8 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -891,15 +891,19 @@ class TTemplate extends TApplicationComponent implements ITemplate else return array(self::CONFIG_EXPRESSION,ltrim($expr,'.')); } - else if(preg_match('/\\s*(<%~.*?%>|<%\\$.*?%>|<%\\[.*?\\]%>)\\s*/msS',$value,$matches) && $matches[0]===$value) + else if(preg_match('/\\s*(<%~.*?%>|<%\\$.*?%>|<%\\[.*?\\]%>|<%\/.*?%>)\\s*/msS',$value,$matches) && $matches[0]===$value) { $value=$matches[1]; - if($value[2]==='~') // a URL + if($value[2]==='~') return array(self::CONFIG_ASSET,trim(substr($value,3,strlen($value)-5))); - else if($value[2]==='[') + elseif($value[2]==='[') return array(self::CONFIG_LOCALIZATION,trim(substr($value,3,strlen($value)-6))); - else if($value[2]==='$') + elseif($value[2]==='$') return array(self::CONFIG_PARAMETER,trim(substr($value,3,strlen($value)-5))); + elseif($value[2]==='/') { + $literal = trim(substr($value,3,strlen($value)-5)); + return array(self::CONFIG_EXPRESSION,"dirname(\$this->getApplication()->getRequest()->getApplicationUrl()).'/$literal'"); + } } else return $value; -- cgit v1.2.3