diff --git a/src/Controller/ComplaintController.php b/src/Controller/ComplaintController.php index e95bff9..ddec743 100644 --- a/src/Controller/ComplaintController.php +++ b/src/Controller/ComplaintController.php @@ -48,8 +48,7 @@ class ComplaintController extends AbstractController { $isSubmitted = null; } - $headerFile = Yaml::parseFile('../config/portalLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP); - return $this->render('complaint.html.twig',['header' => $headerFile, 'form' => $form, 'isSubmitted' => $isSubmitted]); + return $this->render('complaint.html.twig',['form' => $form, 'isSubmitted' => $isSubmitted]); } public function sendEmail(TransportTransportInterface $mailer, string $message, LoggerInterface $log) : bool { diff --git a/src/Controller/SafetyController.php b/src/Controller/SafetyController.php index 1ff48af..1d19a26 100644 --- a/src/Controller/SafetyController.php +++ b/src/Controller/SafetyController.php @@ -17,15 +17,12 @@ class SafetyController extends AbstractController #[Route('/training/safety', name: 'safetyHome')] public function Index() : Response { - $headerFile = Yaml::parseFile('../config/portalLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP); $contentFile = Yaml::parseFile('../config/safetyLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP); - return $this->render('Training/Safety/safetyHome.html.twig',['header' => $headerFile, 'content' => $contentFile]); + return $this->render('Training/Safety/safetyHome.html.twig',['content' => $contentFile]); } #[Route('/training/safety/quiz')] public function Quiz(Request $request, LoggerInterface $log) { - $headerFile = Yaml::parseFile('../config/portalLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP); - $form = $this->createForm(SafetyQuizType::class); $form->handleRequest($request); if($form->isSubmitted() && $form->isValid()) @@ -43,10 +40,10 @@ class SafetyController extends AbstractController } } $log->Debug($testerName . ' quiz answers correct: ' . $correctAnswers); - return $this->render('Training/Safety/quizResults.html.twig', ['header'=>$headerFile, 'testerName'=>$testerName, + return $this->render('Training/Safety/quizResults.html.twig', ['testerName'=>$testerName, 'correctAnswers'=>$correctAnswers, 'totalAnswers'=>count($data)]); } - return $this->render('Training/Safety/SafetyQuiz.html.twig',['header' => $headerFile, 'quiz'=>$form]); + return $this->render('Training/Safety/SafetyQuiz.html.twig',['quiz'=>$form]); } #[Route('/Training/Safety/Topics/{topic?}')] public function Topics(?string $topic) : Response @@ -56,21 +53,7 @@ class SafetyController extends AbstractController { return $this->redirectToRoute('safetyHome'); } - $headerFile = Yaml::parseFile('../config/portalLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP); - $topicsFile = Yaml::parseFile('../config/safetyLinks.yaml', 2, 2, Yaml::PARSE_OBJECT_FOR_MAP); $topic = strtolower($topic); - return $this->render('Training/Safety/Topics/'.$topic.".html.twig", ['headerFile'=> $headerFile]); - /* //Scan through each link file If we see what we need, then let's get it. - foreach($topicsFile['Cards'] as $card) - { - foreach($card as $item) - { - if($item['url']== $topic) - { - return $this->render('Training/Safety/Topics/'.$topic.".html.twig", ['headerFile'=> $headerFile]); - } - } - - } */ + return $this->render('Training/Safety/Topics/'.$topic.".html.twig"); } } \ No newline at end of file