/**
  * Create the routing for a module
  *
  * @return ConsoleModel
  */
 public function routingAction()
 {
     // check for help mode
     if ($this->requestOptions->getFlagHelp()) {
         return $this->routingHelp();
     }
     // output header
     $this->consoleHeader('Creating the routing for a module');
     // get needed options to shorten code
     $path = $this->requestOptions->getPath();
     $moduleName = $this->requestOptions->getModuleName();
     $modulePath = $this->requestOptions->getModulePath();
     // check for module path and application config
     if (!file_exists($path . '/module') || !file_exists($path . '/config/application.config.php')) {
         return $this->sendError(array(array(Color::NORMAL => 'The path '), array(Color::RED => $path), array(Color::NORMAL => ' doesn\'t contain a ZF2 application.')));
     }
     // check if module name provided
     if (!$moduleName) {
         return $this->sendError(array(array(Color::NORMAL => 'Please provide the module name as parameter.')));
     }
     // check if module exists
     if (!file_exists($modulePath)) {
         return $this->sendError(array(array(Color::NORMAL => 'The module '), array(Color::RED => $moduleName), array(Color::NORMAL => ' does not exist.')));
     }
     // write start message
     $this->console->write('       => Creating routing for module ');
     $this->console->writeLine($moduleName, Color::GREEN);
     // set config flag
     $configFlag = false;
     // update controller class
     try {
         // add controller configuration to module
         $moduleConfig = $this->moduleConfigurator->addRouterConfig();
         // check for module config updates
         if ($moduleConfig) {
             // update module configuration
             $configFlag = $this->moduleGenerator->updateConfiguration($moduleConfig, $modulePath . '/config/module.config.php');
             // success message
             $this->console->write('       => Updating configuration for module ');
             $this->console->writeLine($moduleName, Color::GREEN);
             // change flag
             $configFlag = true;
         }
     } catch (GeneratorException $e) {
         $this->console->writeLine();
         return $this->sendError(array(array(Color::NORMAL => 'No controller exist in the module '), array(Color::RED => $moduleName), array(Color::NORMAL => '.')));
     }
     $this->console->writeLine();
     $this->console->write(' Done ', Color::NORMAL, Color::CYAN);
     $this->console->write(' ');
     $this->console->write('The routing has been configured in module ');
     $this->console->writeLine($moduleName, Color::GREEN);
     // output footer
     $this->consoleFooter('routing was successfully created');
 }