Пример #1
0
 public function execute()
 {
     $codeGen = new CodeGen($this);
     $codeGen->execute();
 }
<?php

require_once 'JCrud.php';
require_once 'util.php';
$data = json_decode(file_get_contents("php://input"));
$cg = new CodeGen();
$cg->action = $data->action;
$cg->tableName = $data->tableName;
$cg->tableId = $data->tableId;
$cg->execute();
class CodeGen
{
    public function __construct()
    {
    }
    public $pkColName, $tableName, $tableId, $action, $mysql;
    private static $newLine = "\r\n";
    private static $tab1 = "\t";
    private static $tab2 = "\t\t";
    private static $tab3 = "\t\t\t";
    private static $tab4 = "\t\t\t\t";
    private static $tab5 = "\t\t\t\t\t";
    private function loadData()
    {
        $db = new JCrud();
        $sql = "select * from columns where tableId=? order by orderNo";
        $params[] = $this->tableId;
        $this->allColumns = $db->query2($sql, $params);
    }
    public function execute()
    {
Пример #3
0
 public function generateConfig()
 {
     try {
         $this->deserialize();
         $codeGen = new CodeGen();
         $codeGen->has_template_authorization = $this->has_template_authorization;
         $codeGen->app = $this->jwtApp;
         $codeGen->root = $this->rootPath;
         $codeGen->defaultNavigation = $this->defaultNavigation;
         $codeGen->execute();
     } catch (Exception $ex) {
         throw $ex;
     }
 }