private function renderBody(\Core3\Model\Spreadsheet $model) { $res = ''; foreach ($model->getRows() as $row) { $res .= implode($this->escapeRow($row), $this->delimiter) . $this->lineEnding; } return $res; }
private function renderFooter(\Core3\Model\Spreadsheet $model) { $footer = $model->getFooter(); if (!count($footer)) { return ''; } $html = '<tr>'; $colspan = ''; if (count($model->getColumns()) > count($footer)) { $padCnt = count($model->getColumns()) - count($footer) + 1; $colspan = ' colspan="' . $padCnt . '"'; $html .= '<th' . $colspan . '>' . array_shift($footer) . '</th>'; } foreach ($footer as $col) { $html .= '<th>' . $col . '</th>'; } $html .= '</tr>'; return $html; }
public function render(\Core3\Model\Spreadsheet $model) { return \Core3\Writer\Json::encodeSlim($model->getRows()); }