summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Database/Samples/Scaffold/Home.php
diff options
context:
space:
mode:
authorwei <>2007-01-30 11:36:13 +0000
committerwei <>2007-01-30 11:36:13 +0000
commit7fa1200b5e589a47884aa4d62630ce9099fccee1 (patch)
tree739e307440b4fccf3125ab11719dc09fccefed41 /demos/quickstart/protected/pages/Database/Samples/Scaffold/Home.php
parentfcb45e6479d4c13084c8033e543e0c1fdeead8e5 (diff)
Add basic Scaffold view for Active Record
Diffstat (limited to 'demos/quickstart/protected/pages/Database/Samples/Scaffold/Home.php')
-rw-r--r--demos/quickstart/protected/pages/Database/Samples/Scaffold/Home.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/Database/Samples/Scaffold/Home.php b/demos/quickstart/protected/pages/Database/Samples/Scaffold/Home.php
new file mode 100644
index 00000000..9bfe3f6d
--- /dev/null
+++ b/demos/quickstart/protected/pages/Database/Samples/Scaffold/Home.php
@@ -0,0 +1,33 @@
+<?php
+
+Prado::using('System.Data.ActiveRecord.TActiveRecord');
+Prado::using('System.Data.ActiveRecord.Scaffold.TScaffoldView');
+
+class AddressRecord extends TActiveRecord
+{
+ public $id;
+ public $username;
+ public $phone;
+
+ public static $_tablename='addresses';
+
+ //for demo, we use static db here
+ //otherwise we should use TActiveRecordConfig in application.xml
+ private static $_db;
+ public function getDbConnection()
+ {
+ if(self::$_db===null)
+ {
+ $file = dirname(__FILE__).'/sqlite.db';
+ self::$_db = new TDbConnection("sqlite:{$file}");
+ }
+ return self::$_db;
+ }
+}
+
+class Home extends TPage
+{
+
+}
+
+?> \ No newline at end of file