示例#1
0
 /**
  * Returns the current resolver
  * It also create a new resolver if it's not exists.
  *
  * @return RequestResolvers\RequestResolverInterface
  */
 public function getResolver()
 {
     if ($this->resolver === null) {
         $this->resolver = new $this->resolverClass(UrlRedirect::resolve($this->buildUrl()), $this->resolverConfig);
         $this->parseUrl($this->resolver->getUrl());
     }
     return $this->resolver;
 }
示例#2
0
文件: Request.php 项目: heatery/Embed
 /**
  * Magic method to retrieve the resolver an url in lazy mode
  */
 public function __get($name)
 {
     switch ($name) {
         case 'url':
             return $this->url = new Url($this->resolver->getUrl());
         case 'resolver':
             $this->resolver = new $this->resolverClass(UrlRedirect::resolve($this->startingUrl->getUrl()));
             if (is_array($this->resolverConfig)) {
                 $this->resolver->setConfig($this->resolverConfig);
             }
             return $this->resolver;
     }
 }