summaryrefslogtreecommitdiff
path: root/demos/northwind-db/protected/pages/Home.php
blob: 06035069aa32a3ae189a6210701810f399e51871 (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
<?php

class Home extends TPage
{
	function onInit($param)
	{
		$classes = $this->getRecordClassList(Prado::getPathOfNamespace('Application.database.*'));
		$this->class_list->dataSource = $classes;
		$this->class_list->dataBind();
	}

	protected function getRecordClassList($directory)
	{
		$list=array();
		$folder=@opendir($directory);
		while($entry=@readdir($folder))
		{
			if($entry[0]==='.')
				continue;
			else if(is_file($directory.'/'.$entry))
				$list[] = str_replace('.php', '', $entry);
		}
		closedir($folder);
		return $list;
	}
}

?>