src/Command/Generate/CrudCommand.php
protected function generate(InputInterface $input, OutputInterface $output) : void
    {
        $model = ucfirst($input->getArgument('model'));
        $module = $input->getArgument('module');

        // template data
        $data = [
            'model' => $model,
            'module' => $module
        ];

        // generate CRUD class
        $this->write(" |> Generate CRUD class <info>$model\\Crud</info>");
        $crudFile = $this->getApplication()->getModelPath($model) . DS . 'Crud.php';
        $this->generateFile('CrudTemplate', $crudFile, $data);

        if ($module) {
            if (!$this->getApplication()->isModelExists($model)) {
                throw new InputException(
                    "Model $model is not exist, " .
                    "run command <question>bluzman generate:model $model</question> before"
                );
            }

            $this->write(" |> Generate CRUD controller <info>$module/controllers/crud.php</info>");

            $controllerFile = $this->getControllerPath($module, 'crud');
            $this->generateFile('CrudControllerTemplate', $controllerFile, $data);

            $this->write(" |> Generate CRUD view <info>$module/views/crud.phtml</info>");

            $tableInstance = $this->getTableInstance($model);
            $data['columns'] = $tableInstance::getMeta();

            $viewFile = $this->getViewPath($module, 'crud');
            $this->generateFile('CrudViewTemplate', $viewFile, $data);
        }
    }
protected function generate(InputInterface $input, OutputInterface $output) : void
    {
        $model = ucfirst($input->getArgument('model'));
        $module = $input->getArgument('module');

        // template data
        $data = [
            'model' => $model,
            'module' => $module
        ];

        // generate CRUD class
        $this->write(" |> Generate CRUD class <info>$model\\Crud</info>");
        $crudFile = $this->getApplication()->getModelPath($model) . DS . 'Crud.php';
        $this->generateFile('CrudTemplate', $crudFile, $data);

        if ($module) {
            if (!$this->getApplication()->isModelExists($model)) {
                throw new InputException(
                    "Model $model is not exist, " .
                    "run command <question>bluzman generate:model $model</question> before"
                );
            }

            $this->write(" |> Generate CRUD controller <info>$module/controllers/crud.php</info>");

            $controllerFile = $this->getControllerPath($module, 'crud');
            $this->generateFile('CrudControllerTemplate', $controllerFile, $data);

            $this->write(" |> Generate CRUD view <info>$module/views/crud.phtml</info>");

            $tableInstance = $this->getTableInstance($model);
            $data['columns'] = $tableInstance::getMeta();

            $viewFile = $this->getViewPath($module, 'crud');
            $this->generateFile('CrudViewTemplate', $viewFile, $data);
        }
    }
@param InputInterface  $input
@param OutputInterface $output

@return void
@throws Generator\GeneratorException
@throws InputException