diff options
Diffstat (limited to 'demos/quickstart/protected/QuickStartGlobalization.php')
-rw-r--r-- | demos/quickstart/protected/QuickStartGlobalization.php | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/demos/quickstart/protected/QuickStartGlobalization.php b/demos/quickstart/protected/QuickStartGlobalization.php index 6a0b0fb2..8fc42e8d 100644 --- a/demos/quickstart/protected/QuickStartGlobalization.php +++ b/demos/quickstart/protected/QuickStartGlobalization.php @@ -1,31 +1,31 @@ -<?php
-
-class QuickStartGlobalization extends TGlobalizationAutoDetect
-{
- public function init($xml)
- {
- parent::init($xml);
- $this->Application->OnBeginRequest[] = array($this, 'beginRequest');
- }
-
- public function beginRequest($sender, $param)
- {
- if(null == ($culture=$this->Request['lang']))
- {
- if(null !== ($cookie=$this->Request->Cookies['lang']))
- $culture = $cookie->getValue();
- }
-
- if(is_string($culture))
- {
- $info = new CultureInfo();
- if($info->validCulture($culture))
- {
- $this->setCulture($culture);
- $this->Response->Cookies[] = new THttpCookie('lang',$culture);
- }
- }
- }
-}
-
+<?php + +class QuickStartGlobalization extends TGlobalizationAutoDetect +{ + public function init($xml) + { + parent::init($xml); + $this->Application->OnBeginRequest[] = array($this, 'beginRequest'); + } + + public function beginRequest($sender, $param) + { + if(null == ($culture=$this->Request['lang'])) + { + if(null !== ($cookie=$this->Request->Cookies['lang'])) + $culture = $cookie->getValue(); + } + + if(is_string($culture)) + { + $info = new CultureInfo(); + if($info->validCulture($culture)) + { + $this->setCulture($culture); + $this->Response->Cookies[] = new THttpCookie('lang',$culture); + } + } + } +} + ?>
\ No newline at end of file |