Exemplo n.º 1
0
 public function createEntityAction()
 {
     $request = $this->getRequest();
     $table = $request->getParam('table');
     $savePath = $request->getParam('path');
     $namespace = $request->getParam('namespace');
     $this->createEntityService->create($table, $savePath, $namespace);
     $this->console->write(Util::format("Done, entity is created from {$table}!"), Color::GREEN);
 }
Exemplo n.º 2
0
 public function createHelperAction()
 {
     try {
         $module = $this->params()->fromRoute('module');
         $helperName = $this->params()->fromRoute('helper');
         $this->helperService->createHelper($module, $helperName);
         $this->console->write(Util::format("View Helper: '{$helperName}' is created"), Color::GREEN);
     } catch (\Exception $e) {
         $this->console->write(Util::format($e->getMessage()), Color::RED);
     }
 }
Exemplo n.º 3
0
 public function removeModuleAction()
 {
     try {
         $request = $this->getRequest();
         $module = $request->getParam('module');
         $this->createModuleService->remove($module);
         $this->console->write(Util::format("Module {$module} is removed!"), Color::GREEN);
     } catch (Exception $e) {
         $this->console->write(Util::format($e->getMessage()), Color::RED);
     }
 }
Exemplo n.º 4
0
 public function createServiceAction()
 {
     $module = $this->params()->fromRoute('module');
     $namespace = $this->params()->fromRoute('namespace');
     $serviceName = $this->params()->fromRoute('service');
     try {
         $this->createServiceService->createService($module, $namespace, $serviceName);
         $this->console->write(Util::format("Service: '{$serviceName}' is created"), Color::GREEN);
     } catch (\Exception $e) {
         $this->console->write(Util::format($e->getMessage()), Color::RED);
     }
 }
Exemplo n.º 5
0
 public function createActionAction()
 {
     try {
         $module = $this->params()->fromRoute('module');
         $controller = $this->params()->fromRoute('contr');
         $action = $this->params()->fromRoute('act');
         $this->actionService->createAction($module, $controller, $action);
         $this->console->write(Util::format("Action: '{$action}' in controller is created"), Color::GREEN);
     } catch (\Exception $e) {
         $this->console->write(Util::format($e->getMessage()), Color::RED);
     }
 }
Exemplo n.º 6
0
 public function createMapperAction()
 {
     /**
      * CreateMapperService constructor.
      * @param $tableName
      * @param $parentClassName
      * @param $mapperName
      * @param $namespace
      * @param $path
      */
     $request = $this->getRequest();
     $tableName = $request->getParam('table');
     $parent = $request->getParam('parent');
     $mapper = $request->getParam('mapper');
     $namespace = $request->getParam('namespace');
     $path = $request->getParam('path');
     $this->createMapperService->create($tableName, $parent, $mapper, $namespace, $path);
     $this->console->write(Util::format('Mapper is created!'), Color::GREEN);
 }
Exemplo n.º 7
0
 private function getRouteString($module, $controller, $action)
 {
     $route = strtolower($module . '-' . $controller) . '-' . Util::toDashes($action);
     $template = file_get_contents(__DIR__ . '/../../../../template/Controller/RouteTemplate.txt');
     $replace = ['{route}', '{module}', '{controller}', '{action}'];
     $with = [$route, $module, $controller, $action];
     $template = str_replace($replace, $with, $template);
     return $template;
 }