dcylabs / symfony-twig-helper
A Twig Bundle that help you with rights in Symfony
Package info
github.com/dcylabs/symfony-twig-helper
Type:symfony-bundle
pkg:composer/dcylabs/symfony-twig-helper
dev-master
2016-03-14 18:35 UTC
This package is not auto-updated.
Last update: 2026-03-26 07:27:13 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 %}