diff --git a/src/Controller/DegreeController.php b/src/Controller/DegreeController.php index d7d54e0..90cebd4 100644 --- a/src/Controller/DegreeController.php +++ b/src/Controller/DegreeController.php @@ -71,11 +71,14 @@ final class DegreeController extends AbstractController #[Route('/{id}', name: 'app_degree_delete', methods: ['POST'])] public function delete(Request $request, Degree $degree, EntityManagerInterface $entityManager): Response { - if ($this->isCsrfTokenValid('delete'.$degree->getId(), $request->getPayload()->getString('_token'))) { + // Vérification du token CSRF pour la sécurité + if ($this->isCsrfTokenValid('delete'.$degree->getId(), $request->request->get('_token'))) { + // Suppression du diplôme $entityManager->remove($degree); $entityManager->flush(); } return $this->redirectToRoute('app_degree_index', [], Response::HTTP_SEE_OTHER); } + } diff --git a/src/Entity/Company.php b/src/Entity/Company.php index ae8ccaa..1a3bd2f 100644 --- a/src/Entity/Company.php +++ b/src/Entity/Company.php @@ -62,7 +62,7 @@ class Company return $this; } - public function getAddress(): ?string + public function getAddress(): ?stringz { return $this->address; } diff --git a/templates/announcement/list.html.twig b/templates/announcement/list.html.twig index 541caaa..737f0f4 100644 --- a/templates/announcement/list.html.twig +++ b/templates/announcement/list.html.twig @@ -3,12 +3,18 @@ {% block title %}Bienvenue sur Hegreshpere{% endblock %} {% block body %} +
{{ ann.creationDate|date("d-m-y") }}
{% endfor %} - - -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/degree/show.html.twig b/templates/degree/show.html.twig index fd86e8d..41d349d 100644 --- a/templates/degree/show.html.twig +++ b/templates/degree/show.html.twig @@ -1,26 +1,37 @@ {% extends 'base.html.twig' %} -{% block title %}Degree{% endblock %} +{% block title %}Degrees{% endblock %} {% block body %} -Id | +Label | +Actions | +
---|---|---|
Id | {{ degree.id }} | -|
Label | {{ degree.label }} | ++ View + Edit + + + |