This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
says shat wrond models and attribute #2
Labels
Comments
You need specify an array of models and not just a model. |
how? can give me example? |
In your a controller: public function actionIndex()
{
$models = ModelName::find()->all();
if (Model::loadMultiple($models, Yii::$app->request->post()) && Model::validateMultiple($models)) {
for ($i = 0; $i != count($models); $i++) {
$models[$i]->save(false);
}
return $this->redirect(['index']);
}
return $this->render('index', ['models' => $models]);
} In your a view: echo DynaFields::widget([
'urlAdd' => ['your-action-add'],
'urlRemove' => ['your-action-remove'],
'inputMethod' => 'textInput',
'inputMethodArgs' => [['maxlength' => true]],
'form' => $form,
'models' => $models,
'attribute' => 'attribute',
]); |
Once again, you need specify an ARRAY MODELS and not just a MODEL. You [$modele1, $modele2, $modele3, $modele4] // and etc |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
ERROR: Either 'models' and 'attribute' properties must be specified.
The text was updated successfully, but these errors were encountered: