Example #1
0
 protected function reflectRoute(crud\Route $route, common\_window $window)
 {
     $main = $route->getMain();
     $view = $this->buildCrudView($main);
     $sub = $route->getSub();
     $form = $this->buildCrudView($sub);
     $arguments = $window->getVariable(self::ARGUMENTS_NAME);
     $getArgument = $arguments->call(self::ARGUMENT_METHOD);
     $result = $window->createCondition($window->createTest($getArgument, $sub->getName(), '=='));
     $result->addContent($arguments->call('shift'));
     $result->addContent($this->callScript($form, $window, $window->tokenToInstance('php-integer')));
     $result->addElse($this->callScript($view, $window, $window->tokenToInstance('\\sylma\\dom\\handler')));
     return $result;
 }