Answer the question
In order to leave comments, you need to log in
How to delete an entry via index.html.twig if everything is done in the CRud system?
I tried it like this:
a href="{{ path('category_delete', { 'id': entity.id }) }}"delete>
didn't work.
deleteAction() asks for an id that I don't know where to get it from.
Answer the question
In order to leave comments, you need to log in
keep an example:
1. yaml routing (you can add validations, etc., the symphony is beautifully written in the off-docs)
route_id:
path: /app/delete/{id}
defaults: { _controller:AcmeBundle:FakeControllerName:delete, id: null }
public function deleteAction($id)
{
//в id будет id из урла, реализуем удаление, используя эти данные, не забываем про валидацию
}
1. Wrap the code in a code tag so that it can be read normally.
2. Please provide code deleteAction()
.
3. Give the error that you have when executing the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question