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 |
return | string |
The generated hyperlink |
throws | yii\base\InvalidConfigException |
if the attribute is unknown |
Please login to continue.