luya\console\commands\ActiveWindowController::actionCreate PHP Method

actionCreate() public method

Create a new ActiveWindow class based on you properties.
public actionCreate ( )
    public function actionCreate()
    {
        $name = $this->prompt("Please enter a name for the Active Window:", ['required' => true]);
        $className = $this->createClassName($name, $this->suffix);
        $moduleId = $this->selectModule(['text' => 'What module should ' . $className . ' belong to?', 'onlyAdmin' => true]);
        $module = Yii::$app->getModule($moduleId);
        $folder = $module->basePath . DIRECTORY_SEPARATOR . 'aws';
        $file = $folder . DIRECTORY_SEPARATOR . $className . '.php';
        $content = $this->renderWindowClassView($className, $module->getNamespace() . '\\aws', $moduleId);
        FileHelper::createDirectory($folder);
        if (FileHelper::writeFile($file, $content)) {
            return $this->outputSuccess("The Active Window file '{$file}' has been writtensuccessfull.");
        }
        return $this->outputError("Error while writing the Actice Window file '{$file}'.");
    }