I have created a table using a Controller and Model and in that file show some data.

But i don't know how to save that data in database i have created a table in Magento 2 db. But don't understand how to get those data and save it.

Any help is appriciated.

When i click on send it reload the page and in network it goes to 302 Found.

  • Please share some more details like the table name what are the fields and the code snippets where it would be easy to understand your problem and clear it soon. – Rising Aug 25 '20 at 6:04
  • I have updated my question hope it helps will you please suggest me anything @Rising – Prits Aug 25 '20 at 6:07
  • try this link magento.stackexchange.com/a/310465/82670 – Msquare Aug 25 '20 at 6:12
  • here i added sample module you can check it. i hope this helps you. magento.stackexchange.com/a/317429/82670 – Msquare Aug 25 '20 at 6:13
  • I am not using Admin Grid for my module is it necessary to use it i have just a simple form in that a table to show the data @Msquare – Prits Aug 25 '20 at 6:15

the method you are using is incorrect. Magento 2 provides the UI components for your needs. Here are some examples on how to implement a custom table backend grid and how to save it.

docs: https://devdocs.magento.com/guides/v2.4/ui_comp_guide/howto/new_component_declaration.html




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.