我想创建ActiveForm
没有模型以防万一。我确实尝试过,dynamicModel
但出现了一些错误:
use yii\base\DynamicModel;
$model = DynamicModel::validateData(compact('KOMENTAR'), [
[['KOMENTAR'], 'string', 'max' => 128],
]);
这是我要创建的表格
<br>
<?php $form = ActiveForm::begin([
'method' => 'post',
]); ?>
<?= $form->field($model, 'KOMENTAR')->textarea(['rows' => 6])->label(false) ?>
<div class="form-group">
<?= Html::submitButton('POST', ['class' => 'btn btn-primary']) ?>
</div>
这是错误
Getting unknown property: yii\base\DynamicModel::KOMENTAR