1 | <?php |
||
26 | class HTMLConverter implements Converter |
||
27 | { |
||
28 | use ConverterTrait; |
||
29 | |||
30 | /** |
||
31 | * table class attribute value |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $class_name = 'table-csv-data'; |
||
36 | |||
37 | /** |
||
38 | * table id attribute value |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $id_name = ''; |
||
43 | |||
44 | /** |
||
45 | * @var XMLConverter |
||
46 | */ |
||
47 | protected $xml_converter; |
||
48 | |||
49 | /** |
||
50 | * New Instance |
||
51 | */ |
||
52 | 2 | public function __construct() |
|
60 | |||
61 | /** |
||
62 | * HTML table class name setter |
||
63 | * |
||
64 | * @param string $class_name |
||
65 | * |
||
66 | * @return self |
||
67 | */ |
||
68 | 2 | public function table(string $class_name, string $id_name = ''): self |
|
76 | |||
77 | /** |
||
78 | * HTML tr record offset attribute setter |
||
79 | * |
||
80 | * @param string $record_offset_attribute_name |
||
81 | * |
||
82 | * @return self |
||
83 | */ |
||
84 | 2 | public function tr(string $record_offset_attribute_name): self |
|
91 | |||
92 | /** |
||
93 | * HTML td field name attribute setter |
||
94 | * |
||
95 | * @param string $fieldname_attribute_name |
||
96 | * |
||
97 | * @return self |
||
98 | */ |
||
99 | 2 | public function td(string $fieldname_attribute_name): self |
|
106 | |||
107 | /** |
||
108 | * Convert an Record collection into a DOMDocument |
||
109 | * |
||
110 | * @param array|Traversable $records the CSV records collection |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | 2 | public function convert($records) |
|
122 | } |
||
123 |