diff --git a/core/command/ControllerCreateCmd.php b/core/command/ControllerCreateCmd.php index 4d2474e..2c2c7c5 100644 --- a/core/command/ControllerCreateCmd.php +++ b/core/command/ControllerCreateCmd.php @@ -4,8 +4,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\Question; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Command\Command as BaseCommand; use Hunter\Core\App\Application; use Hunter\Core\Utility\StringConverter; @@ -197,12 +198,16 @@ protected function interact(InputInterface $input, OutputInterface $output) { $classMachineName = $this->stringConverter->createMachineName($class); $routeName = $module . '.' . str_replace("controller", "", $classMachineName) . '_' . $method; + $nocache_question = new ConfirmationQuestion('Enable cache [No]? ', FALSE); + $nocache = $helper->ask($input, $output, $nocache_question); + $routes[] = [ 'title' => $title, 'name' => $routeName, 'method' => $method, 'path' => $path, - 'args' => $this->getArgumentsFromRoute($path) + 'args' => $this->getArgumentsFromRoute($path), + 'nocache' => $nocache ]; } diff --git a/core/command/templates/routing-controller.yml.html b/core/command/templates/routing-controller.yml.html index c8d8784..08a9908 100644 --- a/core/command/templates/routing-controller.yml.html +++ b/core/command/templates/routing-controller.yml.html @@ -7,5 +7,8 @@ defaults: _controller: '\Hunter\\Controller\Controller::' _title: '' - - \ No newline at end of file + +options: + nocache: TRUE + +