Skip to content

View Helpers

pageNumberLinks()

pageNumberLinks() — returns string

Available in: controller Category: Pagination Functions

Creates a windowed set of page number links around the current page. The current page is rendered as a span (not a link) unless linkToCurrentPage is true.

NameTypeRequiredDefaultDescription
windowSizenumericno2The number of page links to show around the current page.
handlestringnoqueryThe handle given to the query that the pagination should be displayed for.
namestringnopageThe name of the param that holds the current page number.
classstringnoCSS class for each page number link.
classForCurrentstringnocurrentCSS class for the current page span or link.
linkToCurrentPagebooleannofalseWhether to render the current page as a link.
prependToPagestringnoString to prepend before each page number.
appendToPagestringnoString to append after each page number.
pageNumberAsParambooleannotrueDecides whether to link the page number as a param or as part of a route.
encodeanynotrueUse this argument to decide whether the output of the function should be encoded in order to prevent Cross Site Scripting (XSS) attacks. Set it to true to encode all relevant output for the specific HTML element in question (e.g. tag content, attribute values, and URLs). For HTML elements that have both tag content and attribute values you can set this argument to attributes to only encode attribute values and not tag content.