diff options
author | rojaro <> | 2010-10-20 20:28:05 +0000 |
---|---|---|
committer | rojaro <> | 2010-10-20 20:28:05 +0000 |
commit | eba9a17c654469e03c758da7ad3db1ca993f5943 (patch) | |
tree | 426789840caa38165e9446c02f82f60679a09965 /framework | |
parent | 50ca2733c11c38408dc2517991d73d6e402fade5 (diff) |
fixed #296
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 12 |
1 files 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;
|