Пример #1
0
 /**
  * Calls the given action of the given controller
  *
  * @param string $controllerName The name of the controller to be called
  * @param string $controllerPackageKey The package key the controller resides in
  * @param string $controllerActionName The name of the action to be called, e.g. 'index'
  * @param array $arguments Optional arguments passed to controller
  * @param string $format The request format, defaults to 'html'
  * @return string The result of the controller action
  * @deprecated since 1.1
  */
 protected function sendWebRequest($controllerName, $controllerPackageKey, $controllerActionName, array $arguments = array(), $format = 'html')
 {
     $this->setupHttp();
     $route = new \TYPO3\FLOW3\Mvc\Routing\Route();
     $route->setName('sendWebRequest Route');
     $uriPattern = 'test/' . uniqid();
     $route->setUriPattern($uriPattern);
     $route->setDefaults(array('@package' => $controllerPackageKey, '@controller' => $controllerName, '@action' => $controllerActionName, '@format' => $format));
     $route->setAppendExceedingArguments(TRUE);
     $this->router->addRoute($route);
     $uri = new \TYPO3\FLOW3\Http\Uri('http://baseuri/' . $uriPattern);
     $response = $this->browser->request($uri, 'POST', $arguments);
     return $response->getContent();
 }
Пример #2
0
 /**
  * Creates TYPO3\FLOW3\Mvc\Routing\Route objects from the injected routes
  * configuration.
  *
  * @return void
  */
 protected function createRoutesFromConfiguration()
 {
     if ($this->routesCreated === FALSE) {
         $this->routes = array();
         foreach ($this->routesConfiguration as $routeConfiguration) {
             $route = new \TYPO3\FLOW3\Mvc\Routing\Route();
             if (isset($routeConfiguration['name'])) {
                 $route->setName($routeConfiguration['name']);
             }
             $route->setUriPattern($routeConfiguration['uriPattern']);
             if (isset($routeConfiguration['defaults'])) {
                 $route->setDefaults($routeConfiguration['defaults']);
             }
             if (isset($routeConfiguration['routeParts'])) {
                 $route->setRoutePartsConfiguration($routeConfiguration['routeParts']);
             }
             if (isset($routeConfiguration['toLowerCase'])) {
                 $route->setLowerCase($routeConfiguration['toLowerCase']);
             }
             if (isset($routeConfiguration['appendExceedingArguments'])) {
                 $route->setAppendExceedingArguments($routeConfiguration['appendExceedingArguments']);
             }
             $this->routes[] = $route;
         }
         $this->routesCreated = TRUE;
     }
 }