this.method

this.method

Twig Property

You can access the current request method object via this.method and it returns the HTTP verb in uppercase.

{% if this.method == 'GET' %}
    <!-- Do GET Logic -->
{% else this.method == 'POST' %}
    <!-- Do POST Logic -->
{% endif %}
On This Page