Prado\Wsat\TWsatScaffoldingGenerator::generate PHP Method

generate() public method

public generate ( $tableName, $viewType )
    public function generate($tableName, $viewType)
    {
        switch ($viewType) {
            default:
            case self::LIST_TYPE:
                $unitName = "list" . ucfirst($tableName);
                break;
            case self::ADD_TYPE:
                $unitName = "add" . ucfirst($tableName);
                break;
            case self::SHOW_TYPE:
                $unitName = "show" . ucfirst($tableName);
                break;
        }
        $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($tableName, $viewType);
        file_put_contents($outputPage, $page);
    }