/** * @inheritdoc * @return string the rendering result. */ public function renderTableBody() { if (!$this->showHeader) { return parent::renderTableBody(); } $models = array_values($this->dataProvider->getModels()); $keys = $this->dataProvider->getKeys(); $rows = []; 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 "\n<tr><td colspan=\"{$colspan}\">" . $this->renderEmpty() . "</td></tr>\n</tbody>"; } else { return "\n" . implode("\n", $rows) . "\n</tbody>"; } }
/** * Renders the table body. * * @return string the rendering result. */ public function renderTableBody() { $content = parent::renderTableBody(); if ($this->showPageSummary) { return $content . $this->renderPageSummary(); } return $content; }
/** * @inheritdoc */ public function renderTableBody() { if (!empty($this->mergeColumns) || !empty($this->extraRowColumns)) { $this->groupColumns(); } return parent::renderTableBody(); }
protected function renderSinglePage($page) { $this->dataProvider->getPagination()->page = $page; $this->dataProvider->prepare(true); $pageContent = parent::renderTableBody(); $pageContent = str_replace('<tbody>', '', $pageContent); $pageContent = str_replace('</tbody>', '', $pageContent); return $pageContent; }
/** * Overide parent::run(). */ public function renderTableBody() { if ($this->dataProvider != null) { return parent::renderTableBody(); } }