{% from 'macros.twig' import pagination %} {% set friends = profile.friends(2)|batch(12) %}

Friends

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

This user has no friends :(

{% endif %}
{% if friends|length > 1 %}
{{ pagination(route('user.profile', profile.id), friends, get.page|default(1)) }}
{% endif %}