| @@ 165-179 (lines=15) @@ | ||
| 162 | * |
|
| 163 | * @return string the rendered view that represents the table |
|
| 164 | */ |
|
| 165 | public function table() |
|
| 166 | { |
|
| 167 | if (empty($this->columns)) { |
|
| 168 | throw new \InvalidArgumentException("There are no columns defined"); |
|
| 169 | } |
|
| 170 | ||
| 171 | return $this->viewFactory |
|
| 172 | ->make($this->tableView, [ |
|
| 173 | 'columns' => $this->columns, |
|
| 174 | 'showHeaders' => $this->printHeaders, |
|
| 175 | 'id' => $this->tableId, |
|
| 176 | 'endpoint' => $this->endpointURL, |
|
| 177 | ]) |
|
| 178 | ->render(); |
|
| 179 | } |
|
| 180 | ||
| 181 | /** |
|
| 182 | * Will render the javascript for the table |
|
| @@ 186-200 (lines=15) @@ | ||
| 183 | * |
|
| 184 | * @return string the rendered view that represents the script |
|
| 185 | */ |
|
| 186 | public function script() |
|
| 187 | { |
|
| 188 | if (empty($this->columns)) { |
|
| 189 | throw new \InvalidArgumentException("There are no columns defined"); |
|
| 190 | } |
|
| 191 | return $this->viewFactory |
|
| 192 | ->make($this->scriptView, [ |
|
| 193 | 'id' => $this->tableId, |
|
| 194 | 'columns' => $this->columns, |
|
| 195 | 'options' => $this->scriptOptions, |
|
| 196 | 'callbacks' => $this->scriptCallbacks, |
|
| 197 | 'endpoint' => $this->endpointURL, |
|
| 198 | ]) |
|
| 199 | ->render(); |
|
| 200 | } |
|
| 201 | ||
| 202 | /** |
|
| 203 | * Will render the table and directly the script after it. This is a shortcut for |
|