In a proper MVC structure, only your controller should interface with your request data, in this case JInput
, and the dependencies injected into the view and model when instantiated within the controller.
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 populateState()
method and views are more often in the layout files they are loading up than the actual class.
manpreet
Best Answer
2 years ago
I'm curious as to where to get data from
JInput
in the MVC design pattern. For example, in a situation where I need aJInput
value to use in a query in a model class method, should I get theJInput
value there or should I pass it from the view or does it matter?