Hot answers tagged

1

craft.app.request.getHeaders() returns an instance of yii\web\HeaderCollection, which has a number of public methods you can use from a Twig template. For example, to see if an isAjax header is present: {# Get the header collection #} {% set headers = craft.app.request.getHeaders() %} {# Test for specific header #} {% set isAjaxRequest = headers.has('isAjax'...


Only top voted, non community-wiki answers of a minimum length are eligible