Skip to content
Advertisement

Yii2 Dynamic Form Error on Create – The ‘model’ property must be set and must extend from ‘yiibaseModel’

In Yii2, I have been trying to create a dynamic form using the below tutorials.
Yii2-dynamicForm – GitHub and Youtube Tutorial.

I followed the same step as mentioned in tutorials, unfortunately I am held up with an error(screenshot attached)Error Screen

And I am not able to resolve this error, can any one help me to find what I am missing.

For the reference I am attaching my Models here, rest the controllers and views are same as the tutorials.

Request Model

JavaScript

RequestItems Model

JavaScript

_form.php

JavaScript

Advertisement

Answer

You need to change the

JavaScript

to

JavaScript

As stated in the basic example, its an array of models and the way you passing, it will be detected as array rather than a model.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement