Answer the question
In order to leave comments, you need to log in
How to display values in ActiveForm of such a table?
There is a blog_conf table, where there are value and keys fields. Unable to display values via ActiveForm. I'm trying to do it like this:
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'value')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('app', 'Update'), ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
public function actionIndex()
{
$model = new Conf();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['index']);
} else {
$model2 = Conf::find()->all();
return $this->render('index', [
'model' => $model2,
]);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question