/** * Generates a "correct" table tag to contain the rendered rows * * @param Table $table * @param array $rows * @param array $headers * @param array $footers * * @return string */ protected function container(Table $table, array $rows, array $headers, array $footers) { $html = '<table'; $this->addAttributes($html, $table->getAttributes()); $html .= '><thead>'; $html .= implode("\n", $headers); $html .= '</thead><tbody>'; $html .= implode("\n", $rows); $html .= '</tbody><tfoot>'; $html .= implode("\n", $footers); $html .= '</tfoot></table>'; return $html; }
/** * @expectedException \InvalidArgumentException * @group Common */ public function testAddInvalidRowType() { $this->object->createRow(42)->addRow(); }
/** * Renders the footer rows for the table * * @param Table $table * * @return array */ protected function buildFooters(Table $table) { //Generate each row $rows = array(); foreach ($table->getFooterRows() as $row) { //Build the cells for each row $cells = array(); foreach ($row as $cell) { $cells[] = $this->footerCell($cell); } $rows[] = $this->footerRow($row, $cells); } return $rows; }