using kendo template with path twig function

1 posts, 0 answers
  1. cascem
    cascem avatar
    1 posts
    Member since:
    Apr 2012

    Posted 19 Apr 2012 Link to this post

    I am using Symfony2 framework and Twig template engine with kendoui. I try to use path twig function inside kendo template. Below are working and non-working codes.

    When i use path twig function without parameters inside kendo template it works well.
    <script id="rowTemplate" type="text/x-kendo-tmpl">
    <tr>
    <td>
    <a href="{{ path('hedehodo') }}">
    <img src="${ name }" alt="${ name }" />
    </a>
    </td>
    </tr>
    </script>

    However when i use path twig function with parameters inside kendo template it doesn't work and Symfony gives "Variable "name" does not exist" error.
    <script id="rowTemplate" type="text/x-kendo-tmpl">
    <tr>
    <td>
    <a href="{{ path('hedehodo', {'name': name }) }}">
    <img src="${ name }" alt="${ name }" />
    </a>
    </td>
    </tr>
    </script>

    How can i make it work path function with parameters?
Back to Top