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: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
This package is not auto-updated.
Last update: 2025-08-14 04:43:30 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 %}