I have created an admin grid and also created an associated form for that grid. And then I have created a table for that grid. Now, how to save the form data that particular grid DB table
-
Here you can get CURD operations. Hope it may help you. magento.stackexchange.com/questions/200022/…– Pramod KharadeCommented Nov 9, 2017 at 15:45
-
Thank you. I have created Model file. But I need to save data in data base. Please suggest me how to modify the above code– JaisaCommented Nov 10, 2017 at 4:47
2 Answers
You have to make a model corresponding to the table, from which you will be able to do all db related stuff.
Following is a good tutorial on how to make model ;
https://www.mageplaza.com/magento-2-module-development/how-to-create-crud-model-magento-2.html
You can create a controller into adminhtml folder and create one model to get table in which you want to save that data Create model factory in your controller and get form data over there using post method and set that data in controller