public function generateActionController($packageKey, $subpackage, $controllerName, $overwrite = false)
    {
        list($baseNamespace, $namespaceEntryPath) = $this->getPrimaryNamespaceAndEntryPath($this->packageManager->getPackage($packageKey));
        $controllerName = ucfirst($controllerName);
        $controllerClassName = $controllerName . 'Controller';

        $templatePathAndFilename = 'resource://Neos.Kickstarter/Private/Generator/Controller/ActionControllerTemplate.php.tmpl';

        $contextVariables = [];
        $contextVariables['packageKey'] = $packageKey;
        $contextVariables['packageNamespace'] = trim($baseNamespace, '\\');
        $contextVariables['subpackage'] = $subpackage;
        $contextVariables['isInSubpackage'] = ($subpackage != '');
        $contextVariables['controllerClassName'] = $controllerClassName;
        $contextVariables['controllerName'] = $controllerName;

        $fileContent = $this->renderTemplate($templatePathAndFilename, $contextVariables);

        $subpackagePath = $subpackage != '' ? $subpackage . '/' : '';
        $controllerFilename = $controllerClassName . '.php';
        $controllerPath = Files::concatenatePaths([$namespaceEntryPath, $subpackagePath, 'Controller']) . '/';
        $targetPathAndFilename = $controllerPath . $controllerFilename;

        $this->generateFile($targetPathAndFilename, $fileContent, $overwrite);

        return $this->generatedFiles;
    }
public function generateActionController($packageKey, $subpackage, $controllerName, $overwrite = false)
    {
        list($baseNamespace, $namespaceEntryPath) = $this->getPrimaryNamespaceAndEntryPath($this->packageManager->getPackage($packageKey));
        $controllerName = ucfirst($controllerName);
        $controllerClassName = $controllerName . 'Controller';

        $templatePathAndFilename = 'resource://Neos.Kickstarter/Private/Generator/Controller/ActionControllerTemplate.php.tmpl';

        $contextVariables = [];
        $contextVariables['packageKey'] = $packageKey;
        $contextVariables['packageNamespace'] = trim($baseNamespace, '\\');
        $contextVariables['subpackage'] = $subpackage;
        $contextVariables['isInSubpackage'] = ($subpackage != '');
        $contextVariables['controllerClassName'] = $controllerClassName;
        $contextVariables['controllerName'] = $controllerName;

        $fileContent = $this->renderTemplate($templatePathAndFilename, $contextVariables);

        $subpackagePath = $subpackage != '' ? $subpackage . '/' : '';
        $controllerFilename = $controllerClassName . '.php';
        $controllerPath = Files::concatenatePaths([$namespaceEntryPath, $subpackagePath, 'Controller']) . '/';
        $targetPathAndFilename = $controllerPath . $controllerFilename;

        $this->generateFile($targetPathAndFilename, $fileContent, $overwrite);

        return $this->generatedFiles;
    }
public function generateActionController ( $ packageKey , $ subpackage , $ controllerName , $ overwrite = false ) { list ( $ baseNamespace , $ namespaceEntryPath ) = $ this -> getPrimaryNamespaceAndEntryPath ( $ this -> packageManager -> getPackage ( $ packageKey ) ) ; $ controllerName = ucfirst ( $ controllerName ) ; $ controllerClassName = $ controllerName . 'Controller' ; $ templatePathAndFilename = 'resource://Neos.Kickstarter/Private/Generator/Controller/ActionControllerTemplate.php.tmpl' ; $ contextVariables = [ ] ; $ contextVariables [ 'packageKey' ] = $ packageKey ; $ contextVariables [ 'packageNamespace' ] = trim ( $ baseNamespace , '\\' ) ; $ contextVariables [ 'subpackage' ] = $ subpackage ; $ contextVariables [ 'isInSubpackage' ] = ( $ subpackage != '' ) ; $ contextVariables [ 'controllerClassName' ] = $ controllerClassName ; $ contextVariables [ 'controllerName' ] = $ controllerName ; $ fileContent = $ this -> renderTemplate ( $ templatePathAndFilename , $ contextVariables ) ; $ subpackagePath = $ subpackage != '' ? $ subpackage . '/' : '' ; $ controllerFilename = $ controllerClassName . '.php' ; $ controllerPath = Files :: concatenatePaths ( [ $ namespaceEntryPath , $ subpackagePath , 'Controller' ] ) . '/' ; $ targetPathAndFilename = $ controllerPath . $ controllerFilename ; $ this -> generateFile ( $ targetPathAndFilename , $ fileContent , $ overwrite ) ; return $ this -> generatedFiles ; }
Generate a controller with the given name for the given package

@param string $packageKey The package key of the controller's package
@param string $subpackage An optional subpackage name
@param string $controllerName The name of the new controller
@param boolean $overwrite Overwrite any existing files?
@return array An array of generated filenames
Generate a controller with the given name for the given package