开发者

connection in between view and database in mvc pattern?

开发者 https://www.devze.com 2023-03-08 04:26 出处:网络
I am newbie to MVCand class in PHP.I have made asmall application in that MVC pattern without any framework.I can access the template through controller and action in view.now my开发者_JAVA百科 proble

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:

  1. In view file you can put a form.
  2. This form send data to a controller.
  3. controller get data and call a function for insert in database, from model
0

精彩评论

暂无评论...
验证码 换一张
取 消