Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | public function actionIndex(string $fieldType = Twigfield::DEFAULT_FIELD_TYPE, string $twigfieldOptions = ''): Response |
||
45 | { |
||
46 | $options = []; |
||
47 | $parsedJson = Json::decodeIfJson($twigfieldOptions); |
||
48 | if (is_array($parsedJson)) { |
||
49 | $options = $parsedJson; |
||
50 | } |
||
51 | $result = Twigfield::getInstance()->autocomplete->generateAutocompletes($fieldType, $options); |
||
52 | |||
53 | return $this->asJson($result); |
||
54 | } |
||
56 |