diff --git a/src/Controller/SafetyController.php b/src/Controller/SafetyController.php index ce785dd..083b29c 100644 --- a/src/Controller/SafetyController.php +++ b/src/Controller/SafetyController.php @@ -96,9 +96,9 @@ class SafetyController extends AbstractController $topic = strtolower($topic); //TODO: Insert back button + $navButtonData = ['previous'=> $previousTopic, 'next' => $nextTopic]; $contents = $this->render('Training/Safety/Topics/'.$topic.".html.twig"); - $navButtons = $this->render('Training/Safety/navButtons.html.twig'); - $debug = "

Prev: " . $previousTopic['url'] . ". Next: " . $nextTopic['url'] . "

"; - return new Response($debug . $contents . $navButtons); + $navButtons = $this->render('Training/Safety/navButtons.html.twig',$navButtonData); + return new Response($contents . $navButtons); } } diff --git a/templates/Training/Safety/navButtons.html.twig b/templates/Training/Safety/navButtons.html.twig new file mode 100644 index 0000000..5c3c1c5 --- /dev/null +++ b/templates/Training/Safety/navButtons.html.twig @@ -0,0 +1,16 @@ + +
+
+
+ {% if previous != null %} + Previous Page: {{previous.title}} + {% endif %} +
+
+ {% if next != null %} + Next Page: {{next.title}} + {% endif %} +
+
+
+ \ No newline at end of file