summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample5.php
blob: de6e5bd9fcb089ee2f8ee413306ac9860d00a1f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php

class Sample5 extends TPage
{
	protected function getData()
	{
		return array(
			array(
				'name'=>'North',
				'detail'=>array(
					array('name'=>'John','age'=>30,'position'=>'Program Manager'),
					array('name'=>'Edward','age'=>35,'position'=>'Developer'),
					array('name'=>'Walter','age'=>28,'position'=>'Developer'),
				),
			),
			array(
				'name'=>'West',
				'detail'=>array(
					array('name'=>'Cary','age'=>31,'position'=>'Senior Manager'),
					array('name'=>'Ted','age'=>25,'position'=>'Developer'),
					array('name'=>'Kevin','age'=>28,'position'=>'Developer'),
				),
			),
			array(
				'name'=>'East',
				'detail'=>array(
					array('name'=>'Shawn','age'=>30,'position'=>'Sales Manager'),
					array('name'=>'Larry','age'=>28,'position'=>'Document Writer'),
				),
			),
			array(
				'name'=>'South',
				'detail'=>array(
					array('name'=>'King','age'=>30,'position'=>'Program Manager'),
					array('name'=>'Carter','age'=>22,'position'=>'Developer'),
				),
			),
		);
	}

	public function onLoad($param)
	{
		parent::onLoad($param);
		if(!$this->IsPostBack)
		{
			$this->Repeater->DataSource=$this->getData();
			$this->Repeater->dataBind();
		}
	}
}

?>