Conditions | 8 |
Paths | 15 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function process() |
||
13 | { |
||
14 | if (!array_key_exists('route', $this->attributes)) { |
||
15 | // TODO: |
||
16 | throw new Ajde_Component_Exception(); |
||
17 | } |
||
18 | $route = $this->attributes['route']; |
||
19 | if (!$route instanceof Ajde_Core_Route) { |
||
20 | $route = new Ajde_Core_Route($route); |
||
21 | } |
||
22 | $controller = Ajde_Controller::fromRoute($route); |
||
23 | if (array_key_exists('vars', |
||
24 | $this->attributes) && is_array($this->attributes['vars']) && !empty($this->attributes['vars']) |
||
25 | ) { |
||
26 | try { |
||
27 | $view = $controller->getView(); |
||
28 | foreach ($this->attributes['vars'] as $key => $var) { |
||
29 | $view->assign($key, $var); |
||
30 | } |
||
31 | } catch (Exception $e) { |
||
|
|||
32 | } |
||
33 | } |
||
34 | |||
35 | return $controller->invoke(); |
||
36 | } |
||
37 | } |
||
38 |