Check if $var is an instance of UrlObject.
public static isUrlObject ( mixed $var ) : boolean | ||
$var | mixed | Element to check. |
return | boolean |
/** * Tries to match the given url against current RouteCollection. * * @param string|UrlObject $url Url to match. * * @return MatchedRoute|bool MatchedRoute instance is returned if url was matched. Otherwise false is returned. */ public function match($url) { if ($this->isString($url)) { $url = $this->url($url); } else { $url = StdObjectWrapper::isUrlObject($url) ? $url : $this->url(''); } // get it from cache if (($result = $this->loadFromCache('match.' . $url->val())) !== false) { return $this->unserialize($result); } // try to match the url $result = $this->urlMatcher->match($url); // cache it $cacheResult = $this->isArray($result) ? $this->serialize($result) : $result; $this->saveToCache('match.' . $url->val(), $cacheResult); return $result; }
/** * Check if $instance is a UrlObject. * * @param mixed $instance * * @return bool */ protected static function isUrlObject($instance) { return StdObjectWrapper::isUrlObject($instance); }