forked from audrey/intranet
render prev next page buttons
This commit is contained in:
parent
40f04f07e6
commit
b053c7b617
@ -96,9 +96,9 @@ class SafetyController extends AbstractController
|
|||||||
|
|
||||||
$topic = strtolower($topic);
|
$topic = strtolower($topic);
|
||||||
//TODO: Insert back button
|
//TODO: Insert back button
|
||||||
|
$navButtonData = ['previous'=> $previousTopic, 'next' => $nextTopic];
|
||||||
$contents = $this->render('Training/Safety/Topics/'.$topic.".html.twig");
|
$contents = $this->render('Training/Safety/Topics/'.$topic.".html.twig");
|
||||||
$navButtons = $this->render('Training/Safety/navButtons.html.twig');
|
$navButtons = $this->render('Training/Safety/navButtons.html.twig',$navButtonData);
|
||||||
$debug = "<body><h3>Prev: " . $previousTopic['url'] . ". Next: " . $nextTopic['url'] . "</h3></body>";
|
return new Response($contents . $navButtons);
|
||||||
return new Response($debug . $contents . $navButtons);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
templates/Training/Safety/navButtons.html.twig
Normal file
16
templates/Training/Safety/navButtons.html.twig
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
{% if previous != null %}
|
||||||
|
<a href="{{previous.url}}">Previous Page: {{previous.title}}</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% if next != null %}
|
||||||
|
<a href="{{next.url}}">Next Page: {{next.title}}</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
Loading…
x
Reference in New Issue
Block a user