connection in between view and database in mvc pattern?
I am newbie to MVC and class in PHP.I have made a small application in that MVC pattern without any framework.I can access the template through controller and action in view.now my开发者_JAVA百科 problem is that when the template is generated how the data inserted into it will be save in the database.So in short I want to know how the view file will save the data into database?
When the view posts back to the controller (ususally via a form), the controller should connect with the Model (database code/class) and save/update the data.
This works in next 3 steps:
- In view file you can put a form.
- This form send data to a controller.
- controller get data and call a function for insert in database, from model
精彩评论