feat: prefill edit form with param's data

This commit is contained in:
b1ek 2024-08-20 16:54:10 +10:00
parent 9193ab8e6d
commit c98ab0988d
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,12 @@ class ListController extends \yii\web\Controller
}
$model = new ParameterForm();
if ($parameter) {
$model->setAttributes([
'title' => $parameter->title,
'type' => $parameter->type,
]);
}
if ($request->isPost) {
$data = $request->post();