This setting can be overwritten for all dynamic Route parts.
public setLowerCase ( boolean $lowerCase ) : void | ||
$lowerCase | boolean | TRUE: Route parts are converted to lower case by default. FALSE: Route parts are not altered. |
리턴 | void |
/** * @test */ public function resolvesKeepsCaseOfResolvedUriIfToLowerCaseIsFalse() { $this->route->setUriPattern('CamelCase/{someKey}'); $this->route->setLowerCase(false); $this->routeValues = ['someKey' => 'CamelCase']; $this->assertTrue($this->route->resolves($this->routeValues)); $this->assertEquals('CamelCase/CamelCase', $this->route->getResolvedUriPath()); }
/** * Creates \Neos\Flow\Mvc\Routing\Route objects from the injected routes * configuration. * * @return void * @throws InvalidRouteSetupException */ protected function createRoutesFromConfiguration() { if ($this->routesCreated === true) { return; } $this->initializeRoutesConfiguration(); $this->routes = []; $routesWithHttpMethodConstraints = []; foreach ($this->routesConfiguration as $routeConfiguration) { $route = new Route(); if (isset($routeConfiguration['name'])) { $route->setName($routeConfiguration['name']); } $uriPattern = $routeConfiguration['uriPattern']; $route->setUriPattern($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']); } if (isset($routeConfiguration['httpMethods'])) { if (isset($routesWithHttpMethodConstraints[$uriPattern]) && $routesWithHttpMethodConstraints[$uriPattern] === false) { throw new InvalidRouteSetupException(sprintf('There are multiple routes with the uriPattern "%s" and "httpMethods" option set. Please specify accepted HTTP methods for all of these, or adjust the uriPattern', $uriPattern), 1365678427); } $routesWithHttpMethodConstraints[$uriPattern] = true; $route->setHttpMethods($routeConfiguration['httpMethods']); } else { if (isset($routesWithHttpMethodConstraints[$uriPattern]) && $routesWithHttpMethodConstraints[$uriPattern] === true) { throw new InvalidRouteSetupException(sprintf('There are multiple routes with the uriPattern "%s" and "httpMethods" option set. Please specify accepted HTTP methods for all of these, or adjust the uriPattern', $uriPattern), 1365678432); } $routesWithHttpMethodConstraints[$uriPattern] = false; } $this->routes[] = $route; } $this->routesCreated = true; }