1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10:
11:
12: namespace App\Components;
13:
14: use Nette,
15: App\Lib\Html;
16:
17: 18: 19:
20: class TableControl extends Component {
21:
22:
23: private $table;
24:
25: 26: 27: 28:
29: public function create() {
30: return $this->table->code;
31: }
32:
33: 34: 35: 36: 37: 38:
39: public function setParams($params) {
40: parent::setParams($params);
41: if ($this->action->state) {
42: if (is_array($params)){
43: $data = $this->action->relevance;
44: $fields = $this->action->getRelevancestruct()->column;
45: $params = $params['link'];
46: }else{
47: $fields = $this->action->table->column;
48: $data = $this->action->data->data;
49: }
50: $this->table = new Html\Table($params, $fields, $data, $this->action->table->footer, ($this->name));
51: } else {
52: throw new Nette\InvalidArgumentException('Parametry akce nejsou nadefinovány');
53: }
54: }
55: }
56: