What is the right way to handle $_POST data in MVC?

前端 未结 5 1129
时光取名叫无心
时光取名叫无心 2020-11-28 06:10

I have the common MVC situation in my PHP system: the Controller receive a request from the View containing $_POST data. Now I have th

5条回答
  •  广开言路
    2020-11-28 06:18

    'C' is best option. You should not let raw $POST data go in model as model is supposed to be generic handling store and load operations mainly.

    Example : same model can be used web interface and Web services. On Web $_POST is valid but for web services its not. So model doesnt care how data is received but only how to store and load it.

    Yii is definitely a clean implementation of MVC.

提交回复
热议问题