data\Sort init()

init() public method Normalizes the $attributes property. public void init ( )

data\Sort hasAttribute()

hasAttribute() public method Returns a value indicating whether the sort definition supports sorting by the named attribute. public boolean hasAttribute ( $name )$name string The attribute name return boolean Whether the sort definition supports sorting by the named attribute.

data\Sort getOrders()

getOrders() public method Returns the columns and their corresponding sort directions. public array getOrders ( $recalculate = false )$recalculate boolean Whether to recalculate the sort directions return array The columns (keys) and their corresponding sort directions (values). This can be passed to yii\db\Query::orderBy() to construct a DB query.

data\Sort getAttributeOrders()

getAttributeOrders() public method Returns the currently requested sort information. public array getAttributeOrders ( $recalculate = false )$recalculate boolean Whether to recalculate the sort directions return array Sort directions indexed by attribute names. Sort direction can be either SORT_ASC for ascending order or SORT_DESC for descending order.

data\Sort getAttributeOrder()

getAttributeOrder() public method Returns the sort direction of the specified attribute in the current request. public boolean|null getAttributeOrder ( $attribute )$attribute string The attribute name return boolean|null Sort direction of the attribute. Can be either SORT_ASC for ascending order or SORT_DESC for descending order. Null is returned if the attribute is invalid or does not need to be sorted.

data\Sort createUrl()

createUrl() public method Creates a URL for sorting the data by the specified attribute. This method will consider the current sorting status given by $attributeOrders. For example, if the current page already sorts the data by the specified attribute in ascending order, then the URL created will lead to a page that sorts the data by the specified attribute in descending order. See also: $attributeOrders $params public string createUrl ( $attribute, $absolute = false )$attribute string T

data\Sort createSortParam()

createSortParam() public method Creates the sort variable for the specified attribute. The newly created sort variable can be used to create a URL that will lead to sorting by the specified attribute. public string createSortParam ( $attribute )$attribute string The attribute name return string The value of the sort variable throws yii\base\InvalidConfigException if the specified attribute is not defined in $attributes

data\Sort $urlManager

$urlManager public property The URL manager used for creating sort URLs. If not set, the urlManager application component will be used. public yii\web\UrlManager $urlManager = null

data\Sort $sortParam

$sortParam public property The name of the parameter that specifies which attributes to be sorted in which direction. Defaults to sort. See also $params. public string $sortParam = 'sort'

data\Sort $separator

$separator public property The character used to separate different attributes that need to be sorted by. public string $separator = ','