summaryrefslogtreecommitdiff
path: root/framework/Wsat/TWsatScaffoldingGenerator.php
diff options
context:
space:
mode:
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>
}
?>