BcBaserHelper::isCurrentUrl PHP Method

isCurrentUrl() public method

《比較例》 news/ | /news/ ・・・○ news | /news/ ・・・× news/ | /news/index ・・・○
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;
    }