KnpLabs / KnpRadBundle

Rapid Application Development for Symfony2 [UNMAINTAINED]
MIT License
291 stars 49 forks source link

The function "link_attr" does not exist in App:Member:index.html.twig #82

Closed GromNaN closed 11 years ago

GromNaN commented 11 years ago

Following example on "csrf protected links", the function link_attr is not found.

<a {{ link_attr('delete', 'Are you really sure ?') }} href="{{ path('app_member_delete', { 'id': member.id }) }}">Supprimer</a>

I'm using Symfony v2.2.1 and the "develop" branch of this bundle.


    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "doctrine/orm": "~2.3",
        "doctrine/doctrine-bundle": "1.2.*@alpha",
        "sensio/distribution-bundle": "2.2.*",
        "knplabs/rad-bundle": "2.3",
        "knplabs/knp-menu-bundle":"~1.1.0@dev",

        "twig/extensions": "1.0.*@dev",

        "symfony/assetic-bundle": "2.1.*",
        "kriswallsmith/assetic": "1.1.*@dev",

        "doctrine/doctrine-fixtures-bundle": "2.1.*@dev",
        "doctrine/data-fixtures": "1.0.*@dev",

        "mopa/bootstrap-bundle": "2.1.*@dev",
        "mopa/composer-bridge": "*@dev",
        "stof/doctrine-extensions-bundle": "~1.1@dev",

        "friendsofsymfony/user-bundle": "*",
        "sonata-project/admin-bundle": "2.2.*@dev",
        "sonata-project/doctrine-orm-admin-bundle": "2.2.*@dev",
        "sonata-project/user-bundle": "2.2.*@dev",
        "sonata-project/block-bundle": "2.2.*@dev"
    },
docteurklein commented 11 years ago

Oh, I may have an idea. Did you enable this in your app/config ?

You have to explicitly enable this functionality:


knp_rad:
    csrf_links:
        enabled: true
GromNaN commented 11 years ago

Thanks :clap: It works.

This should be added in the default config of the rad-edition ?

docteurklein commented 11 years ago

Yes maybe! We didn't enable it by default because it adds a request listener that could possibly not be used.

docteurklein commented 11 years ago

By the way, we should put that in the docs! [EDIT] Oh just saw you modified the wiki. Thanks!