1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace Atk4\Ui\Table\Column;
6:
7: use Atk4\Data\Field;
8: use Atk4\Data\Model;
9: use Atk4\Ui\Table;
10:
11: /**
12: * Use this decorator if you have HTML code that you just want to put into the table cell.
13: */
14: class Html extends Table\Column
15: {
16: #[\Override]
17: public function getDataCellHtml(Field $field = null, array $attr = []): string
18: {
19: return '{$_' . $field->shortName . '}';
20: }
21:
22: #[\Override]
23: public function getHtmlTags(Model $row, ?Field $field): array
24: {
25: return ['_' . $field->shortName => '<td>' . $row->get($field->shortName) . '</td>'];
26: }
27: }
28: