// AcceptHeaderMatcher when matching the request.
$request->headers->
set('Accept', 'text/html'
);
// Find the system path by resolving aliases, language prefix, etc.
$processed =
$this->pathProcessor->
processInbound($path,
$request);
if (empty($processed) || !
empty($exclude[$processed])) { // This resolves to the front page, which we already add.
return NULL;
} $this->currentPath->
setPath($processed,
$request);
// Attempt to match this path to provide a fully built request.
try { $request->attributes->
add($this->router->
matchRequest($request));
return $request;
} catch (ParamNotConvertedException
$e) { return NULL;
} catch (ResourceNotFoundException
$e) { return NULL;
} catch (MethodNotAllowedException
$e) { return NULL;
}