yii\widgets\BaseListView::renderSorter PHP Method

renderSorter() public method

Renders the sorter.
public renderSorter ( ) : string
return string the rendering result
    public function renderSorter()
    {
        $sort = $this->dataProvider->getSort();
        if ($sort === false || empty($sort->attributes) || $this->dataProvider->getCount() <= 0) {
            return '';
        }
        /* @var $class LinkSorter */
        $sorter = $this->sorter;
        $class = ArrayHelper::remove($sorter, 'class', LinkSorter::className());
        $sorter['sort'] = $sort;
        $sorter['view'] = $this->getView();
        return $class::widget($sorter);
    }