1 | <?php |
||
16 | class DatatableView |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var ColumnConfiguration[] the column configuration if any |
||
21 | */ |
||
22 | private $columnConfigurations; |
||
23 | |||
24 | /** |
||
25 | * Indicates if the columnConfigurations should be reset on a call to columns. |
||
26 | */ |
||
27 | private $resetColumns = true; |
||
28 | /** |
||
29 | * @var null|string |
||
30 | */ |
||
31 | private $tableView; |
||
32 | /** |
||
33 | * @var null|string |
||
34 | */ |
||
35 | private $scriptView; |
||
36 | /** |
||
37 | * @var null|Version |
||
38 | */ |
||
39 | private $version; |
||
40 | |||
41 | /** |
||
42 | * @var Factory |
||
43 | */ |
||
44 | private $viewFactory; |
||
45 | |||
46 | /** |
||
47 | * @var bool true if the columns are also printed as headers on the table, false otherwise |
||
48 | */ |
||
49 | private $printHeaders; |
||
50 | |||
51 | /** |
||
52 | * DatatableView constructor, will take a view as a string if a custom one should be used. will also take the |
||
53 | * column configurations to provide out of the box headers for the view. |
||
54 | * If no columns are given the user must provide them before building the view. |
||
55 | * @param string|null $tableView the name of the view that should be rendered for the table |
||
56 | * @param string|null $scriptView the name of the view that should be rendered for the script |
||
57 | * @param Version|null $version The version that supports the current request |
||
58 | * @param Factory $viewFactory The factory used to render the views |
||
59 | * @param array $columnConfiguration The columnConfiguration of the the server side if available |
||
60 | */ |
||
61 | public function __construct( |
||
74 | |||
75 | /** |
||
76 | * Indicates that the current columns should have a header on the table |
||
77 | */ |
||
78 | public function headers() { |
||
81 | |||
82 | /** |
||
83 | * Will set the columns for the view |
||
84 | */ |
||
85 | public function columns() |
||
92 | |||
93 | /** |
||
94 | * Will render the table |
||
95 | * |
||
96 | * @return View the view that represents the table |
||
97 | */ |
||
98 | public function table() |
||
105 | |||
106 | /** |
||
107 | * Will render the javascript for the table |
||
108 | * |
||
109 | * @return View the view that represents the script |
||
110 | */ |
||
111 | public function script() |
||
118 | } |