symfony2 - let a html button call a Controller Action -
symfony2 - let a html button call a Controller Action -
how can create html button
(like <button type="button" class="btn btn-warning btn-xs">delete</button>)
call controller action deleteaction($project) within twig code?(or java script)
in twig template
<a href="{{ path('delete_route_name', {'id': entity.id }) }}">delete</a> on controller
/** * @param user $entity * * @route("/{id}/entity-remove", requirements={"id" = "\d+"}, name="delete_route_name") * @return redirectresponse * */ public function deleteactionname(user $entity) ... symfony2 twig
Comments
Post a Comment