Conditions | 3 |
Paths | 4 |
Total Lines | 32 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function run() |
||
|
|||
28 | { |
||
29 | $id = 'input_tree__' . $this->getId(); |
||
30 | $this->options['id'] = $id; |
||
31 | |||
32 | if ($this->hasModel()) { |
||
33 | $input = Html::activeHiddenInput($this->model, $this->attribute, $this->options); |
||
34 | } else { |
||
35 | $input = Html::hiddenInput($this->name, $this->value, $this->options); |
||
36 | } |
||
37 | |||
38 | $this->treeConfig['id'] = $id . '__tree'; |
||
39 | $oldOptions = isset($this->treeConfig['options']) ? $this->treeConfig['options'] : []; |
||
40 | $this->treeConfig['options'] = ArrayHelper::merge($oldOptions, [ |
||
41 | 'core' => [ |
||
42 | 'multiple' => $this->multiple, |
||
43 | 'dblclick_toggle' => false, |
||
44 | ], |
||
45 | ]); |
||
46 | |||
47 | return $this->render( |
||
48 | 'tree-input', |
||
49 | [ |
||
50 | 'id' => $id, |
||
51 | 'treeConfig' => $this->treeConfig, |
||
52 | 'multiple' => $this->multiple, |
||
53 | 'selectIcon' => $this->selectIcon, |
||
54 | 'selectText' => $this->selectText, |
||
55 | 'input' => $input, |
||
56 | ] |
||
57 | ); |
||
58 | } |
||
59 | } |
||
60 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.