{% set friends = profile.friends(2)|batch(12) %} {% set paginationPages = friends %} {% set paginationUrl %}{{ route('user.profile', profile.id) }}{% endset %}

Friends

{% if friends|length > 0 %} {% for friend in friends[get.page|default(1) - 1] %}
{{ friend.username }}
{{ friend.username }}
{% endfor %}
{% else %}

This user has no friends :(

{% endif %}
{% if friends|length > 1 %}
{% include 'elements/pagination.twig' %}
{% endif %}