diff options
author | xue <> | 2005-12-28 20:17:54 +0000 |
---|---|---|
committer | xue <> | 2005-12-28 20:17:54 +0000 |
commit | e8b60312037e54c34a06d6f57d7c21946cf3cd1f (patch) | |
tree | a6f35f5d4bb921998ca306602a33fc03ba47c4b5 /framework/Web/UI/TTemplateManager.php | |
parent | 930c51a6d618d487105cd46c517f36c3b1fe3b44 (diff) |
Modified the way to access application singleton.
IService and IModule interfaces are also adjusted accordingly.
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 21a01b25..544c346f 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -37,24 +37,18 @@ class TTemplateManager extends TModule * Prefix of the cache variable name for storing parsed templates
*/
const TEMPLATE_CACHE_PREFIX='prado:template:';
- /**
- * @var TApplication application instance
- */
- private $_application;
/**
* Initializes the module.
* This method is required by IModule and is invoked by application.
* It starts output buffer if it is enabled.
- * @param TApplication application
* @param TXmlElement module configuration
*/
- public function init($application,$config)
+ public function init($config=null)
{
- parent::init($application,$config);
+ parent::init($config);
- $this->_application=$application;
- $application->getService()->setTemplateManager($this);
+ $this->getService()->setTemplateManager($this);
}
/**
@@ -76,7 +70,7 @@ class TTemplateManager extends TModule {
if(($fileName=realpath($fileName))!==false && is_file($fileName))
{
- if(($cache=$this->_application->getCache())===null)
+ if(($cache=$this->getApplication()->getCache())===null)
return new TTemplate(file_get_contents($fileName),dirname($fileName),$fileName);
else
{
@@ -351,7 +345,7 @@ class TTemplate extends TComponent implements ITemplate $component->$setter($url);
break;
case self::CONFIG_PARAMETER: // application parameter
- $component->$setter(Prado::getApplication()->getParameters()->itemAt($v));
+ $component->$setter($this->getApplication()->getParameters()->itemAt($v));
break;
default: // an error if reaching here
break;
@@ -388,7 +382,7 @@ class TTemplate extends TComponent implements ITemplate $component->setSubProperty($name,$url);
break;
case self::CONFIG_PARAMETER: // application parameter
- $component->setSubProperty($name,Prado::getApplication()->getParameters()->itemAt($v));
+ $component->setSubProperty($name,$this->getApplication()->getParameters()->itemAt($v));
break;
default: // an error if reaching here
break;
@@ -419,7 +413,7 @@ class TTemplate extends TComponent implements ITemplate $value=$this->_assetManager->publishFilePath($this->_contextPath.'/'.ltrim($value[1],'/'));
break;
case self::CONFIG_PARAMETER:
- $value=Prado::getApplication()->getParameters()->itemAt($value[1]);
+ $value=$this->getApplication()->getParameters()->itemAt($value[1]);
break;
default:
break;
|