Conditions | 7 |
Paths | 16 |
Total Lines | 24 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | protected function toHtml($table) { |
||
28 | $html = '<table ' . ($this->cssClass ? 'class="' . $this->cssClass . '"' : null) . '><thead><tr>'; |
||
29 | |||
30 | foreach ($table['thead'] as $header) { |
||
31 | $html .= '<th>' . $header['value'] . '</th>'; |
||
32 | } |
||
33 | |||
34 | $html .= '</tr></thead><tbody>'; |
||
35 | |||
36 | foreach ($table['tbody'] as $row) { |
||
37 | $html .= '<tr>'; |
||
38 | |||
39 | foreach ($row['body'] as $column => $cell) { |
||
40 | if ($this->headerColumns && in_array(($column + 1), Arr::wrap($this->headerColumns))) { |
||
41 | $html .= '<th>' . $cell['value'] . '</th>'; |
||
42 | } else { |
||
43 | $html .= '<td>' . $cell['value'] . '</td>'; |
||
44 | } |
||
45 | } |
||
46 | |||
47 | $html .= '</tr>'; |
||
48 | } |
||
49 | |||
50 | return $html . '</tbody></table>'; |
||
51 | } |
||
52 | } |