blob: 72297ac871b7e232c758200f1f0971e8992e1ac7 (
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;
}
}
?>
|