data\Sort link()

link() public method

Generates a hyperlink that links to the sort action to sort by the specified attribute.

Based on the sort direction, the CSS class of the generated hyperlink will be appended with "asc" or "desc".

public string link ( $attribute, $options = [] )
$attribute string

The attribute name by which the data should be sorted by.

$options array

Additional HTML attributes for the hyperlink tag. There is one special attribute label which will be used as the label of the hyperlink. If this is not set, the label defined in $attributes will be used. If no label is defined, yii\helpers\Inflector::camel2words() will be called to get a label. Note that it will not be HTML-encoded.

return string

The generated hyperlink

throws yii\base\InvalidConfigException

if the attribute is unknown

doc_Yii
2016-10-30 16:56:05
Comments
Leave a Comment

Please login to continue.