data\Sort init()

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

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 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 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 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 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 $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 $route

$route public property The route of the controller action for displaying the sorted contents. If not set, it means using the currently requested route. public string $route = null

data\Sort $orders

$orders public read-only property The columns (keys) and their corresponding sort directions (values). This can be passed to yii\db\Query::orderBy() to construct a DB query. public array getOrders ( $recalculate = false )