Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function createGrid($gridClass) |
||
27 | { |
||
28 | if (!class_exists($gridClass)) { |
||
29 | throw new \InvalidArgumentException( |
||
30 | 'Grid class with name ' . $gridClass . ' does not exist.' |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | /** @var Grid $grid */ |
||
35 | $grid = $this->container->make($gridClass); |
||
36 | |||
37 | if (method_exists($grid, 'boot')) { |
||
38 | // call method boot() if exists |
||
39 | $this->container->call([&$grid, 'boot']); |
||
40 | } |
||
41 | |||
42 | $grid->buildGrid(); |
||
43 | |||
44 | return $grid; |
||
45 | } |
||
46 | |||
55 |