public static function sortOrder($attribute = null)
    {
        if (!empty($attribute)) {
            $sort = Yii::$app->request->get('sort');
            if ($sort == $attribute) {
                return ' ' . Html::tag('span', '', ['class' => 'glyphicon glyphicon-sort-by-alphabet']);
            }
            if ($sort == '-' . $attribute) {
                return ' ' . Html::tag('span', '', ['class' => 'glyphicon glyphicon-sort-by-alphabet-alt']);
            }
        }

        return null;
    }
public static function sortOrder($attribute = null)
    {
        if (!empty($attribute)) {
            $sort = Yii::$app->request->get('sort');
            if ($sort == $attribute) {
                return ' ' . Html::tag('span', '', ['class' => 'glyphicon glyphicon-sort-by-alphabet']);
            }
            if ($sort == '-' . $attribute) {
                return ' ' . Html::tag('span', '', ['class' => 'glyphicon glyphicon-sort-by-alphabet-alt']);
            }
        }

        return null;
    }
public static function sortOrder ( $ attribute = null ) { if ( ! empty ( $ attribute ) ) { $ sort = Yii :: $ app -> request -> get ( 'sort' ) ; if ( $ sort == $ attribute ) { return ' ' . Html :: tag ( 'span' , '' , [ 'class' => 'glyphicon glyphicon-sort-by-alphabet' ] ) ; } if ( $ sort == '-' . $ attribute ) { return ' ' . Html :: tag ( 'span' , '' , [ 'class' => 'glyphicon glyphicon-sort-by-alphabet-alt' ] ) ; } } return null ; }
Returns sorting icon.
@param string|null $attribute sorting attribute name
@return string|null icon HTML or null if empty attribute
Returns sorting icon .