diff --git a/src/ZFTool/Controller/CreateController.php b/src/ZFTool/Controller/CreateController.php index e3dcb46..13a7c9a 100644 --- a/src/ZFTool/Controller/CreateController.php +++ b/src/ZFTool/Controller/CreateController.php @@ -151,6 +151,29 @@ public function controllerAction() $phtml = true; } + // Add the new controller key to the invokables + $moduleConfig = require "$path/module/$module/config/module.config.php"; + $invokableKey = ucfirst($module) . '\Controller\\' . $ucName; + + if (!in_array($invokableKey, $moduleConfig['controllers']['invokables'])) { + $moduleConfig['controllers']['invokables'][$invokableKey] = ucfirst($module) . '\Controller\\' . $controller; + copy("$path/module/$module/config/module.config.php", "$path/module/$module/config/module.config.old"); + + $content = <<generate()) && $phtml == true) { $console->writeLine("The controller $name has been created in module $module.", Color::GREEN); } else {