Files
herbarium/templates/post/_delete_form.html.twig

5 lines
294 B
Twig

<form method="post" action="{{ path('app_post_delete', {'id': post.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ post.id) }}">
<button class="btn btn-danger">Delete</button>
</form>