/** * @return boolean * @param string $url */ public function match($url) { $domain = $this->getSubDomain(); $matches = array(); if (1 !== preg_match($this->domainPattern, $domain, $matches)) { return false; } if (null == $this->pattern) { $this->matches = $matches; return true; } $result = parent::match($url); if ($result) { $this->matches = array_merge($matches, $this->matches); } return $result; }
/** * @return boolean * @param Nano_Route $route * @param string $url */ public function test(Nano_Route $route, $url) { if (false === $route->match($url)) { return false; } $this->buildParams($route->matches()); return true; }