public function renderItems()
    {
        $rows = [];
        $this->dataProvider->setKeys([]);
        $models = array_values($this->dataProvider->getModels());
        $models = $this->normalizeData($models, $this->parentRootValue);
        $this->dataProvider->setModels($models);
        $this->dataProvider->setKeys(null);
        $this->dataProvider->prepare();
        $keys = $this->dataProvider->getKeys();
        foreach ($models as $index => $model) {
            $key = $keys[$index];
            if ($this->beforeRow !== null) {
                $row = call_user_func($this->beforeRow, $model, $key, $index, $this);
                if (!empty($row)) {
                    $rows[] = $row;
                }
            }

            $rows[] = $this->renderTableRow($model, $key, $index);

            if ($this->afterRow !== null) {
                $row = call_user_func($this->afterRow, $model, $key, $index, $this);
                if (!empty($row)) {
                    $rows[] = $row;
                }
            }
        }

        if (empty($rows)) {
            $colspan = count($this->columns);
            return "<tr><td colspan=\"$colspan\">" . $this->renderEmpty() . "</td></tr>";
        } else {
            return implode("\n", $rows);
        }
    }
public function renderItems()
    {
        $rows = [];
        $this->dataProvider->setKeys([]);
        $models = array_values($this->dataProvider->getModels());
        $models = $this->normalizeData($models, $this->parentRootValue);
        $this->dataProvider->setModels($models);
        $this->dataProvider->setKeys(null);
        $this->dataProvider->prepare();
        $keys = $this->dataProvider->getKeys();
        foreach ($models as $index => $model) {
            $key = $keys[$index];
            if ($this->beforeRow !== null) {
                $row = call_user_func($this->beforeRow, $model, $key, $index, $this);
                if (!empty($row)) {
                    $rows[] = $row;
                }
            }

            $rows[] = $this->renderTableRow($model, $key, $index);

            if ($this->afterRow !== null) {
                $row = call_user_func($this->afterRow, $model, $key, $index, $this);
                if (!empty($row)) {
                    $rows[] = $row;
                }
            }
        }

        if (empty($rows)) {
            $colspan = count($this->columns);
            return "<tr><td colspan=\"$colspan\">" . $this->renderEmpty() . "</td></tr>";
        } else {
            return implode("\n", $rows);
        }
    }
public function renderItems ( ) { $ rows = [ ] ; $ this -> dataProvider -> setKeys ( [ ] ) ; $ models = array_values ( $ this -> dataProvider -> getModels ( ) ) ; $ models = $ this -> normalizeData ( $ models , $ this -> parentRootValue ) ; $ this -> dataProvider -> setModels ( $ models ) ; $ this -> dataProvider -> setKeys ( null ) ; $ this -> dataProvider -> prepare ( ) ; $ keys = $ this -> dataProvider -> getKeys ( ) ; foreach ( $ models as $ index => $ model ) { $ key = $ keys [ $ index ] ; if ( $ this -> beforeRow !== null ) { $ row = call_user_func ( $ this -> beforeRow , $ model , $ key , $ index , $ this ) ; if ( ! empty ( $ row ) ) { $ rows [ ] = $ row ; } } $ rows [ ] = $ this -> renderTableRow ( $ model , $ key , $ index ) ; if ( $ this -> afterRow !== null ) { $ row = call_user_func ( $ this -> afterRow , $ model , $ key , $ index , $ this ) ; if ( ! empty ( $ row ) ) { $ rows [ ] = $ row ; } } } if ( empty ( $ rows ) ) { $ colspan = count ( $ this -> columns ) ; return "<tr><td colspan=\"$colspan\">" . $ this -> renderEmpty ( ) . "</td></tr>" ; } else { return implode ( "\n" , $ rows ) ; } }
Renders the data models for the grid view.
Renders the data models for the grid view .