Monday 15 April 2013

php - Call function of Controller in TWIG -



php - Call function of Controller in TWIG -

i have table list of clients , button of edition , button must phone call function defined in controller

<td> <a href="#" class="btn default btn-xs purple"> <i class="fa fa-edit"></i> edit </a></td> <td>

how can phone call function editaction ?

at first, read this, this, , this doc pages. after that, final template should this:

<table> {% client in clients %} <tr> <td> <a href="{{ path('my_route', {'id':client.id}) }}" class="btn default btn-xs purple"> <i class="fa fa-edit"></i> edit </a> <td> </tr> {% endfor %} </table>

php symfony2 twig

No comments:

Post a Comment