示例#1
0
                    $folder = 'model';
                    break;
                case 'controller':
                    $extension = 'Controller.php';
                    $folder = 'controller';
                    break;
                case 'javascript':
                    $extension = '.js';
                    $folder = 'javascript';
                    break;
                case 'service':
                    $extension = 'Service.php';
                    $folder = 'service';
                    break;
                case 'html':
                    $extension = '.php';
                    $folder = 'view';
                    break;
            }
            //
            if (file_exists('./' . $folder . '/' . $_GET['targetTable'] . $extension)) {
                unlink('./' . $folder . '/' . $_GET['targetTable'] . $extension);
            }
            $fp = fopen('./' . $folder . '/' . $_GET['targetTable'] . $extension, 'w');
            $generator->setProject($_GET['project']);
            fwrite($fp, $generator->execute());
        }
    }
}
?>