Tdt\Core\ContentNegotiator::fetchUrl PHP Method

fetchUrl() private static method

Fetch the url without the extension
private static fetchUrl ( string $extension = '' ) : string
$extension string The extracted extension from the request
return string
    private static function fetchUrl($extension = '')
    {
        $url = \Request::url();
        if (!empty($extension)) {
            $extension = '.' . strtolower($extension);
        }
        $pos = strrpos($url, $extension);
        if ($pos !== false) {
            $url = substr_replace($url, '', $pos, strlen($extension));
        }
        return $url;
    }