How can i use form generator for the best results yii2?

As i need to create a form for getting user input and store it to the database. what are all the process involved in doing so by using yii2?

I have tested with following steps which is not working anymore:

created model using model generator i. given "profile" as table name ii.given "Profile" as model name iii. previewed and generated pages





created controller using controller generator i. given "profile" as controller ID ii.given "add","edit","view" and "delete" as action IDs





created form using form generator i. given view name as "profile/add" ii. given model class as "app\models\profile"

viewed in browser as below:

web/index.php/profile/add

but it is not working throwing error messages. Please anyone help on this issue.

thanks in advance!

Does your application resolve web/index.php or does nothing work at all? Have you enabled pretty urls or should you be using: web/index.php?r=profile/add. Are all the files in the correct place? Is it complaining about namespaces? That is a common error, and usually when it complains about namespaces, the problem is with the namespaces.