summaryrefslogtreecommitdiff
path: root/framework/Wsat/TWsatScaffoldingGenerator.php
diff options
context:
space:
mode:
authorDaniel <darthdaniel85@gmail.com>2014-10-24 13:11:17 -0500
committerDaniel <darthdaniel85@gmail.com>2014-10-24 13:11:17 -0500
commita7d2609ab842b9002c6225fb54462d416e0b9673 (patch)
tree4ae7d06a8587dcc77a3f665bd70670e3484e4c1b /framework/Wsat/TWsatScaffoldingGenerator.php
parenta31c1f2ff0f4c996e0b90b1743b775af4cf58e6a (diff)
Scaffolding 12%
Diffstat (limited to 'framework/Wsat/TWsatScaffoldingGenerator.php')
-rw-r--r--framework/Wsat/TWsatScaffoldingGenerator.php41
1 files changed, 40 insertions, 1 deletions
diff --git a/framework/Wsat/TWsatScaffoldingGenerator.php b/framework/Wsat/TWsatScaffoldingGenerator.php
index 37b8ae00..7986793d 100644
--- a/framework/Wsat/TWsatScaffoldingGenerator.php
+++ b/framework/Wsat/TWsatScaffoldingGenerator.php
@@ -9,7 +9,6 @@
* @since 3.3
* @package Wsat
*/
-
Prado::using("System.Wsat.TWsatBaseGenerator");
class TWsatScaffoldingGenerator extends TWsatBaseGenerator
@@ -20,6 +19,46 @@ class TWsatScaffoldingGenerator extends TWsatBaseGenerator
parent::__construct();
}
+ public function generate()
+ {
+ $unitName = "Example";
+ $class = $this->generateClass($unitName);
+ $outputClass = $this->_opFile . DIRECTORY_SEPARATOR . $unitName . ".php";
+ file_put_contents($outputClass, $class);
+
+ $outputPage = $this->_opFile . DIRECTORY_SEPARATOR . $unitName . ".page";
+ $page = $this->generatePage($unitName);
+ file_put_contents($outputPage, $page);
+ }
+
+ // <editor-fold defaultstate="collapsed" desc="Generate Sigle Page">
+ private function generatePage($fileName, $tContentId = "Content")
+ {
+ return <<<EOD
+<com:TContent ID="Content">
+
+</com:TContent>
+EOD;
+ }
+
+ private function generateClass($classname)
+ {
+ $date = date('Y-m-d h:i:s');
+ $env_user = getenv("username");
+ return <<<EOD
+<?php
+/**
+ * Auto generated by PRADO - WSAT on $date.
+ * @author $env_user
+ */
+class $classname extends TPage
+{
+
+}
+EOD;
+ }
+
+// </editor-fold>
}
?>