I'm curious as to where to get data from
JInput in the MVC design pattern. For example, in a situation where I need a
JInput value to use in a query in a model class method, should I get the
JInput value there or should I pass it from the view or does it matter?
In a proper MVC structure, only your controller should interface with your request data, in this case
With the current CMS structure, all three pieces of the MVC structure are often interfacing with the request data. In models, this is usually done in the
I'm of the strong belief that it should be retrieved where appropriate.
That is to say you should always use
JInput doesn't offer such feature; so you might have to use $_POST.
if you can have the input be in the form of array (and use JInput::getArray() )
a json-encoded object (you use json_decode(JInput::getString()))