dcylabs / symfony-twig-helper
A Twig Bundle that help you with rights in Symfony
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
This package is not auto-updated.
Last update: 2025-01-16 02:02:47 UTC
README
Updating composer.json
composer require dcylabs/symfony-twig-helper dev-master
OR
"require": { "dcylabs/symfony-twig-helper": "dev-master" }
Updating AppKernel.php
// app/AppKernel.php $bundles = array( // ... new Dcylabs\TwigBundle\DcylabsTwigBundle(), );
Using Dcylabs Twig Bundle
Checking roles
{% checkRoles '/myPath' %} If I can read this I have the rights on the url : "{{ check_url }}" {% else %} I don't have the rights {% endcheckRoles %}
{% checkRoles '/pathOne' '/pathTwo' '/pathThree' %} If I can read this I have the rights on the urls : "{{ check_urls | join(';') }}" {% else %} I don't have the rights {% endcheckRoles %}