diff options
author | xue <> | 2006-01-29 06:23:48 +0000 |
---|---|---|
committer | xue <> | 2006-01-29 06:23:48 +0000 |
commit | 80c39c977568b5b84f5ea2b93f8c1e8d799d558a (patch) | |
tree | 17499ddb161fdc2c02b70103d3884c88a6d8a7d8 /demos/quickstart/protected/pages/Advanced | |
parent | 24045b84ba097055de34b16d5438b1ed0eb5474c (diff) |
Made example working with PHP 5.0.4.
Diffstat (limited to 'demos/quickstart/protected/pages/Advanced')
-rw-r--r-- | demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php b/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php index 9d3a7e99..6451b506 100644 --- a/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php +++ b/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php @@ -1,24 +1,25 @@ <?php
-class Home extends TPage
+class Home extends TPage
{
/**
* Change the globalization culture using value from request "lang" parameter.
*/
- public function __construct()
+ protected function onPreInit($param)
{
+ parent::onPreInit($param);
$lang = $this->Request['lang'];
if(CultureInfo::validCulture($lang)) //only valid lang is permitted
$this->Application->Globalization->Culture = $lang;
- parent::__construct();
}
-
+
/**
* Initialize the page with some arbituary data.
* @param TEventParameter event parameter.
- */
- function onLoad($param)
+ */
+ protected function onLoad($param)
{
+ parent::onLoad($param);
$time1 = $this->Time1;
$time1->Value = time();
@@ -30,13 +31,13 @@ class Home extends TPage /**
* Get the localized current culture name.
- * @return string localized curreny culture name.
+ * @return string localized curreny culture name.
*/
- function getCurrentCulture()
+ public function getCurrentCulture()
{
- $culture = $this->Application->getGlobalization()->Culture;
+ $culture = $this->getApplication()->getGlobalization()->getCulture();
$cultureInfo = new CultureInfo($culture);
- return $cultureInfo->NativeName;
+ return $cultureInfo->getNativeName();
}
}
|