Using the form elements extension

Dot-twigrenderer extends Twig with a function based on TwigTest that checks if each Form element is an instance of its class.

public function getTests(): array;

Example usage

{% if false not in getTests() %}

    {# your code #}

{% endif %}