Skip to content

Commit

Permalink
[TwigBundle] replaced the ifrole tag with a has_role function
Browse files Browse the repository at this point in the history
Before:

{% ifrole "ROLE_ADMIN" %}
    Only show if you have the ROLE_ADMIN role...
{% endifrole %}

After:

{% if has_role("ROLE_ADMIN") %}
    Only show if you have the ROLE_ADMIN role...
{% endif %}
  • Loading branch information
fabpot committed Dec 19, 2010
1 parent f9036ca commit faac8e6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 123 deletions.
14 changes: 2 additions & 12 deletions src/Symfony/Bundle/TwigBundle/Extension/SecurityExtension.php
Expand Up @@ -39,20 +39,10 @@ public function vote($role, $object = null)
/**
* {@inheritdoc}
*/
public function getFilters()
public function getGlobals()
{
return array(
);
}

/**
* {@inheritdoc}
*/
public function getTokenParsers()
{
return array(
// {% ifrole "ROLE_ADMIN" %}something{% endifrole %}
new IfRoleTokenParser(),
'has_role' => new \Twig_Function($this, 'vote'),
);
}

Expand Down
52 changes: 0 additions & 52 deletions src/Symfony/Bundle/TwigBundle/Node/IfRoleNode.php

This file was deleted.

59 changes: 0 additions & 59 deletions src/Symfony/Bundle/TwigBundle/TokenParser/IfRoleTokenParser.php

This file was deleted.

0 comments on commit faac8e6

Please sign in to comment.