Limiting queries with a pager
We can add and list messages from the database. But we must limit the amount of information a user can see. A good practice is to provide the user with a pager to move through all the data.
Follow the given steps to add a simple pager:
- Modify the template
/app/website/templates/components/_list-messages.html
to add a simple pager divided into two buttons (forward and back):{% for message in messages %} <article class="message" id="message--{{ message.id }}"> <h2 class="message__author">{{ message.author }}</h2> <p class="message__text">{{ message.text }} </p> <...