Skip to content

Paginate ​

Type
Class
Namespace
craft\web\twig\variables
Inherits
craft\web\twig\variables\Paginate » yii\base\BaseObject
Implements
yii\base\Configurable
Since
3.0.0

Paginate variable class.

View source

Public Properties ​

PropertyDescription
basePathstring
currentPageinteger
dynamicRangeUrlsstring[]
firstinteger
firstUrlstring, null
lastinteger
lastUrlstring, null
nextUrlstring, null
nextUrlsarray
pageTriggerstring
prevUrlstring, null
prevUrlsarray
totalinteger
totalPagesinteger

basePath ​

Type
string
Default value
null

View source

currentPage ​

Type
integer
Default value
null

View source

dynamicRangeUrls ​

Type
string[]
Default value
null
Access
Read-only

View source

first ​

Type
integer
Default value
null

View source

firstUrl ​

Type
string, null
Default value
null
Access
Read-only

View source

last ​

Type
integer
Default value
null

View source

lastUrl ​

Type
string, null
Default value
null
Access
Read-only

View source

nextUrl ​

Type
string, null
Default value
null
Access
Read-only

View source

nextUrls ​

Type
array
Default value
null
Access
Read-only

View source

pageTrigger ​

Type
string
Default value
null
Since
3.7.64

View source

prevUrl ​

Type
string, null
Default value
null
Access
Read-only

View source

prevUrls ​

Type
array
Default value
null
Access
Read-only

View source

total ​

Type
integer
Default value
0

View source

totalPages ​

Type
integer
Default value
0

View source

Public Methods ​

MethodDescription
__call()Calls the named method which is not a class method.
__construct()Constructor.
__get()Returns the value of an object property.
__isset()Checks if a property is set, i.e. defined and not null.
__set()Sets value of an object property.
__unset()Sets an object property to null.
canGetProperty()Returns a value indicating whether a property can be read.
canSetProperty()Returns a value indicating whether a property can be set.
className()Returns the fully qualified name of this class.
create()Creates a new instance based on a Paginator object
getBasePath()Returns the base path that should be used for pagination URLs.
getDynamicRangeUrls()Returns a dynamic range of page URLs that surround (and include) the current page.
getFirstUrl()Returns the URL to the first page.
getLastUrl()Returns the URL to the next page.
getNextUrl()Returns the URL to the next page.
getNextUrls()Returns next page URLs up to a certain distance from the current page.
getPageUrl()Returns the URL to a specific page
getPrevUrl()Returns the URL to the previous page.
getPrevUrls()Returns previous page URLs up to a certain distance from the current page.
getRangeUrls()Returns a range of page URLs.
hasMethod()Returns a value indicating whether a method is defined.
hasProperty()Returns a value indicating whether a property is defined.
init()Initializes the object.
setBasePath()Sets the base path that should be used for pagination URLs.

create() ​

Since
3.1.19

Creates a new instance based on a Paginator object

View source

Arguments ​

Returns ​

static

getBasePath() ​

Returns the base path that should be used for pagination URLs.

View source

Returns ​

string

getDynamicRangeUrls() ​

Returns a dynamic range of page URLs that surround (and include) the current page.

View source

Arguments ​

  • $max (integer) – The maximum number of links to return

Returns ​

string[]

getFirstUrl() ​

Returns the URL to the first page.

View source

Returns ​

string, null

getLastUrl() ​

Returns the URL to the next page.

View source

Returns ​

string, null

getNextUrl() ​

Returns the URL to the next page.

View source

Returns ​

string, null

getNextUrls() ​

Returns next page URLs up to a certain distance from the current page.

View source

Arguments ​

Returns ​

array

getPageUrl() ​

Returns the URL to a specific page

View source

Arguments ​

Returns ​

string, null

getPrevUrl() ​

Returns the URL to the previous page.

View source

Returns ​

string, null

getPrevUrls() ​

Returns previous page URLs up to a certain distance from the current page.

View source

Arguments ​

Returns ​

array

getRangeUrls() ​

Returns a range of page URLs.

View source

Arguments ​

Returns ​

string[]

init() ​

Initializes the object.

This method is invoked at the end of the constructor after the object is initialized with the given configuration.

View source

setBasePath() ​

Since
3.1.28

Sets the base path that should be used for pagination URLs.

View source

Arguments ​