blob: 57694caa23b5c968218270ec9c066c3916531474 (
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 NorthwindCrud 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) && strpos($entry,'.php'))
$list[] = str_replace('.php', '', $entry);
}
closedir($folder);
return $list;
}
}
?>
|