Inheritance: extends Sulu\Bundle\ContentBundle\Document\RouteDocument
Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function invalidateRoute($webspaceKey, RouteDocument $routeDocument)
 {
     $this->cacheHandler->invalidatePath(PathHelper::relativizePath($routeDocument->getPath(), $this->getRoutesPath($webspaceKey)));
 }
Beispiel #2
0
 /**
  * Add redirect to current custom-url.
  *
  * @param Request $request
  * @param RouteDocument $routeDocument
  * @param RouteCollection $collection
  * @param string $webspaceKey
  *
  * @return RouteCollection
  */
 private function addHistoryRedirectToRouteCollection(Request $request, RouteDocument $routeDocument, RouteCollection $collection, $webspaceKey)
 {
     $resourceSegment = PathHelper::relativizePath($routeDocument->getTargetDocument()->getPath(), $this->getRoutesPath($webspaceKey));
     $url = sprintf('%s://%s', $request->getScheme(), $resourceSegment);
     $collection->add(uniqid('custom_url_route_', true), new Route($request->getPathInfo(), ['_controller' => 'SuluWebsiteBundle:Default:redirect', '_finalized' => true, 'url' => $url]));
     return $collection;
 }