diff --git a/src/Controller/FAQController.php b/src/Controller/FAQController.php index fbba2aa..2a3aa50 100644 --- a/src/Controller/FAQController.php +++ b/src/Controller/FAQController.php @@ -30,6 +30,7 @@ final class FAQController extends AbstractController $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { + $fAQ->setUpdateDate(new \DateTime()); $entityManager->persist($fAQ); $entityManager->flush(); @@ -57,6 +58,7 @@ final class FAQController extends AbstractController $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { + $fAQ->setUpdateDate(new \DateTime()); $entityManager->flush(); return $this->redirectToRoute('app_faq_index', [], Response::HTTP_SEE_OTHER); diff --git a/src/Form/AnnouncementType.php b/src/Form/AnnouncementType.php index cc5b5ba..c6c87ed 100644 --- a/src/Form/AnnouncementType.php +++ b/src/Form/AnnouncementType.php @@ -35,4 +35,4 @@ class AnnouncementType extends AbstractType 'data_class' => Announcement::class, ]); } -} +} \ No newline at end of file diff --git a/src/Form/FAQType.php b/src/Form/FAQType.php index c420a1c..0038157 100644 --- a/src/Form/FAQType.php +++ b/src/Form/FAQType.php @@ -13,11 +13,7 @@ class FAQType extends AbstractType { $builder ->add('question') - ->add('answer') - ->add('updateDate', null, [ - 'widget' => 'single_text', - ]) - ; + ->add('answer'); } public function configureOptions(OptionsResolver $resolver): void diff --git a/templates/faq/index.html.twig b/templates/faq/index.html.twig index 46efd88..be69921 100644 --- a/templates/faq/index.html.twig +++ b/templates/faq/index.html.twig @@ -10,18 +10,18 @@
ID | Question | Réponse | +Denrnière modif | Actions |
---|---|---|---|---|
{{ faq.id }} | {{ faq.question }} | {{ faq.answer }} | +{{ faq.updateDate|date("d-m-y") }} | Voir diff --git a/templates/faq/show.html.twig b/templates/faq/show.html.twig index b635ecc..1b986f3 100644 --- a/templates/faq/show.html.twig +++ b/templates/faq/show.html.twig @@ -24,7 +24,6 @@ |