yii\grid\GridView::renderTableFooter PHP Method

renderTableFooter() public method

Renders the table footer.
public renderTableFooter ( ) : string
return string the rendering result.
    public function renderTableFooter()
    {
        $cells = [];
        foreach ($this->columns as $column) {
            /* @var $column Column */
            $cells[] = $column->renderFooterCell();
        }
        $content = Html::tag('tr', implode('', $cells), $this->footerRowOptions);
        if ($this->filterPosition === self::FILTER_POS_FOOTER) {
            $content .= $this->renderFilters();
        }
        return "<tfoot>\n" . $content . "\n</tfoot>";
    }

Usage Example

Example #1
0
 /**
  * Renders the table footer.
  *
  * @return string the rendering result.
  */
 public function renderTableFooter()
 {
     $content = parent::renderTableFooter();
     return strtr($content, ['<tfoot>' => "<tfoot>\n" . $this->generateRows($this->beforeFooter), '</tfoot>' => $this->generateRows($this->afterFooter) . "\n</tfoot>"]);
 }