Skip to content

List methods

list.setPage(int page)

Sets the page of internal paginator.

{{ list.setPage(2) }}

list.nextPage()

Sets the page to the next page of internal paginator.

{{ list.nextPage() }}

list.prevPage()

Sets the page to the previous page of internal paginator.

{{ list.prevPage() }}

list.setItemCountPerPage(int itemCountPerPage)

Sets the number of items in a page of internal paginator.

{{ list.setItemCountPerPage(10) }}

list.hasAtLeast(int minCount)

Checks whether the list contains at least minCount items. Prefer this over list.count > 0 or list.count > 1 checks - unlike count, it does not necessarily count every matching item, so it can be significantly cheaper for large lists.

{% if list.hasAtLeast(1) %}
    {# list is not empty #}
{% endif %}