Exemple #1
0
 /**
  * Prepares the Host part of a image resize URL
  *
  * @return mixed Route reference type
  */
 private function prepareRouterContext()
 {
     if ($this->generatedRouteHost) {
         $this->router->setContext($this->modifiedContext);
         /**
          * When a Host is set for the image route,
          * we need to change the route context URL
          */
         $this->router->getContext()->setHost($this->generatedRouteHost);
     }
 }
Exemple #2
0
 /**
  * @return UrlGeneratorInterface
  */
 public function getGenerator()
 {
     $this->generator->setContext($this->getContext());
     return $this->generator;
 }
 /**
  * {@inheritdoc}
  */
 public function setContext(RequestContext $context)
 {
     $this->wrapped->setContext($context);
 }
 /**
  * @depends testUrlGeneratorInterface
  *
  * @param UrlGeneratorInterface $generator
  */
 public function testRequestContext($generator)
 {
     $generator->setContext(new RequestContext('/bolt'));
     $this->assertSame('/bolt', $generator->getContext()->getBaseUrl());
 }
Exemple #5
0
 /**
  * {@inheritdoc}
  */
 public function setContext(RequestContext $context)
 {
     $this->router->setContext($context);
 }