Using CookieConsent to render conditional HTML in a Twig template #645
fabian-st
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I created this very simple extension for Symfony Twig, which allows you to check if a user has given their consent for a specific category:
To use the extension, place it under
src/App/Twig/ConsentExtension.php
and include it in your services.yaml:Afterwards, use it in your Twig templates as follows:
Beta Was this translation helpful? Give feedback.
All reactions