Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
class Home extends TPage
4
{
5
	/**
6
	 * Change the globalization culture using value from request "lang" parameter.
7
	 */
8
	public function __construct()
9
	{
10
		parent::__construct();
11
		$lang = $this->Request['lang'];
12
		$info = new CultureInfo();
13
		if($info->validCulture($lang)) //only valid lang is permitted
14
			$this->getApplication()->getGlobalization()->setCulture($lang);
15
	}
16
 
17
	/**
18
	 * Initialize the page with some arbituary data.
19
	 * @param TEventParameter event parameter.
20
	 */
21
	public function onLoad($param)
22
	{
23
		parent::onLoad($param);
24
		$time1 = $this->Time1;
25
		$time1->Value = time();
26
 
27
		$number2 = $this->Number2;
28
		$number2->Value = 46412.416;
29
 
30
		$this->dataBind();
31
	}
32
 
33
	/**
34
	 * Get the localized current culture name.
35
	 * @return string localized curreny culture name.
36
	 */
37
	public function getCurrentCulture()
38
	{
39
		$culture = $this->getApplication()->getGlobalization()->getCulture();
40
		$cultureInfo = new CultureInfo($culture);
41
		return $cultureInfo->getNativeName();
42
	}
43
}
44
 
45
?>