Organizational Research By

Surprising Reserch Topic

what is the right way to handle post data in mvc


what is the right way to handle post data in mvc  using -'php,model-view-controller,post,controller'

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

a) The Controller only calls the Model and the Model handle the $_POST data.
b) The Controller transforms the $_POST data into variables and pass them to Model.
c) The Controller transforms $_POST data into a Model's domain object and only pass the object to Model.

Currently, I am following option A, but I believe it is wrong, so I am thinking of using option C.

So, according to MVC, what is the right way to handle $_POST data?

EDIT At the moment, I'm not using any MVC framework.

EDIT 2 Generally, the same Controller handles request from a browser, a web service, an offline application, etc, or each one has it own Controller?
    

asked Sep 24, 2015 by sanjaypal1983
0 votes
6 views



Related Hot Questions

5 Answers

0 votes
NULL
answered Sep 24, 2015 by rajesh
0 votes
NULL
answered Sep 24, 2015 by rajeevr642
0 votes
NULL
answered Sep 24, 2015 by vibhorsingh
0 votes
NULL
answered Sep 24, 2015 by vijaygupta1980
0 votes
NULL
answered Sep 24, 2015 by santosh soni

...