Commit ed9e18de authored by Tobias Munk's avatar Tobias Munk

added settings support for php_class dropdown

parent 83047c08
......@@ -31,6 +31,11 @@ setup.sh
```
### Settings
`availablePhpClasses`
Usage
-----
......
......@@ -31,4 +31,9 @@ class WidgetTemplate extends BaseWidgetTemplate
]
);
}
public function optPhpClass(){
$json = Yii::$app->settings->get('availablePhpClasses', 'widgets', []);
return Json::decode($json->scalar);
}
}
......@@ -43,7 +43,7 @@ use yii\helpers\Html;
<p>
<?php echo $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?php echo $form->field($model, 'php_class')->textInput(['maxlength' => true]) ?>
<?php echo $form->field($model, 'php_class')->dropDownList($model->optPhpClass()) ?>
<?php echo $form->field($model, 'json_schema')->widget(\trntv\aceeditor\AceEditor::className(), ['mode'=>'json']) ?>
<?php echo $form->field($model, 'twig_template')->widget(\trntv\aceeditor\AceEditor::className(), ['mode'=>'twig']) ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment