Commit f52e068b authored by Mat's avatar Mat
Browse files

pagination, hop

parent 0af45a95
......@@ -47,7 +47,7 @@ class LegumeController extends Controller
if ($page < 1) {
throw $this->createNotFoundException("Page ".$page." inexistante");
}
$nbPerPage = 10;
$nbPerPage = 15;
$em = $this->getDoctrine()->getManager();
$legumes = $em->getRepository('PotageBundle:Legume')->findAllByRead($page, $nbPerPage);
......@@ -56,7 +56,7 @@ class LegumeController extends Controller
if ($page > $nbPerPage) {
throw $this->createNotFoundException("Page ".$page." inexistante");
}
return $this->render('@Potage/Legume/read.html.twig', array(
'legumes' => $legumes,
'nbPages' => $nbPages,
......
......@@ -50,23 +50,23 @@
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
<li class="page-item disabled">
{#<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
<span class="sr-only">Précédent</span>
</a>
</li>
</li>#}
{% for p in range(1, nbPages)%}
<li class="page-item {% if p == page %}active{% endif %}">
<a class="page-link" href="{{ path('potage_legume_read', {'page': p}) }}">{{ p }}</a>
</li>
{% endfor %}
<li class="page-item">
{#<li class="page-item">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
<span class="sr-only">Suivant</span>
</a>
</li>
</li>#}
</ul>
</nav>
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment