public isCurrentUrl ( string $url ) : boolean | ||
$url | string | 比較対象URL |
return | boolean | 同じ場合には true を返す |
public function isCurrentUrl($url)
{
$pattern = '/\\/$/';
$shortenedUrl = preg_replace($pattern, '/index', $this->getUrl($url));
$shortenedHere = preg_replace($pattern, '/index', $this->request->here);
return $shortenedUrl === $shortenedHere;
}