Я хотел бы создать метод для удаления пользователя, который классифицировал в таблице, это мой метод.
public function deletetAction(User $user)
{
if (!$user) {
throw $this->createNotFoundException('No user found');
}
$em = $this->getDoctrine()->getEntityManager();
$em->remove($user);
$em->flush();
return $this->redirectToRoute('index_User');
}
, и я называю этот метод в своих представлениях, как этот index.html.twig
<tbody>
{% for user in useres %}
<tr>
<td> {{user.username}} </td>
<td> {{user.email}} </td>
<td> {{user.date(user.LastLogin)}}</td>
<td> {{user.enabled}} </td>
<td class="center hidden-400">
<a href="{{ path('delete_User', {'salt':user.salt }) }}"class="glyphicon glyphicon-pencil">delete </a>
</td>
<td>{{user.roles[0]}}</td>
</tr>
{% endfor %}
</tbody>
но когда я выполняю индекс маршрута, появляется эта ошибка