diff options
Diffstat (limited to 'demos/northwind-db/protected/pages/NorthwindCrud.php')
-rw-r--r-- | demos/northwind-db/protected/pages/NorthwindCrud.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/demos/northwind-db/protected/pages/NorthwindCrud.php b/demos/northwind-db/protected/pages/NorthwindCrud.php new file mode 100644 index 00000000..57694caa --- /dev/null +++ b/demos/northwind-db/protected/pages/NorthwindCrud.php @@ -0,0 +1,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;
+ }
+}
+
+?>
\ No newline at end of file |