protected function isOnPage($page, $loose = true)
    {
        $page = $loose ? $page : '^'.$page.'$';
        $page = str_replace('#', '\#', $page);

        return (bool) preg_match('#'.$page.'#', $this->request->path());
    }
protected function isOnPage($page, $loose = true)
    {
        $page = $loose ? $page : '^'.$page.'$';
        $page = str_replace('#', '\#', $page);

        return (bool) preg_match('#'.$page.'#', $this->request->path());
    }
protected function isOnPage ( $ page , $ loose = true ) { $ page = $ loose ? $ page : '^' . $ page . '$' ; $ page = str_replace ( '#' , '\#' , $ page ) ; return ( bool ) preg_match ( '#' . $ page . '#' , $ this -> request -> path ( ) ) ; }
Check if a string matches the given url.

@param string $page
@param bool   $loose

@return bool
Check if a string matches the given url .