1 | <?php |
||
7 | class CTable implements \Anax\DI\IInjectionAware |
||
8 | { |
||
9 | use \Anax\DI\TInjectable; |
||
10 | private $data = array(); |
||
11 | private $html = ''; |
||
|
|||
12 | private $headings = ''; |
||
13 | |||
14 | private $tags = array( |
||
15 | 'table_start' => '<table>', |
||
16 | 'table_end' => '</table>', |
||
17 | 'tr_start' => '<tr>', |
||
18 | 'tr_end' => '</tr>', |
||
19 | 'td_start' => '<td>', |
||
20 | 'td_end' => '</td>', |
||
21 | 'th_start' => '<th>', |
||
22 | 'th_end' => '</th>' |
||
23 | ); |
||
24 | |||
25 | /** |
||
26 | * Set up custom tags for designing the table |
||
27 | * @param array $data Array containing the tags to define |
||
28 | * @return void |
||
29 | */ |
||
30 | 1 | public function defineTags($data = array()) { |
|
35 | |||
36 | /** |
||
37 | * Define the headings for the table |
||
38 | * @param array $data Array containing the headings |
||
39 | * @return void |
||
40 | */ |
||
41 | 1 | public function defineHeadings($data = array()) { |
|
51 | |||
52 | /** |
||
53 | * Adds a row to the table one by one |
||
54 | * @param array $data Array containing one key for each field |
||
55 | * @return void |
||
56 | */ |
||
57 | 1 | public function createRow($data = array()) { |
|
60 | |||
61 | /** |
||
62 | * Generate the HTML for the table. Either using $this->data or data as argument |
||
63 | * @param array $data Optional array to be used |
||
64 | * if no data has been set before through "create_row" |
||
65 | * @return string The HTML to be returned |
||
66 | */ |
||
67 | 6 | public function generate($data = array()) { |
|
88 | } |
||
89 |
This check marks private properties in classes that are never used. Those properties can be removed.