Symfony\Component\HttpFoundation\Request::isXmlHttpRequest
Returns true if the request is a XMLHttpRequest.
It works if your JavaScript library set an X-Requested-With HTTP header. It is known to work with common JavaScript frameworks:
Signature
public function isXmlHttpRequest()
Returns
- Boolean
- true if the request is an XMLHttpRequest, false otherwise