• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Access to XenForo_Input from XenForo_Model

digitalpoint

Well-known member
#1
Hopefully, I'm just blind, but is there a way to access cleaned input variables from a XenForo_Model object?

Really I just want to do XenForo_Input::__get('cleanedvar');

But there is no $this->_input object or anything else I can find in the XenForo_Model scope.
 

vbresults

Well-known member
#2
Hopefully, I'm just blind, but is there a way to access cleaned input variables from a XenForo_Model object?

Really I just want to do XenForo_Input::__get('cleanedvar');

But there is no $this->_input object or anything else I can find in the XenForo_Model scope.
This doesn't exist or belong in the model. I know it doesn't answer your question, but it may prevent a headache or two. :p

Extend the model, create a new method, and pass the filtered input in through a controller.
 

digitalpoint

Well-known member
#3
Blah... that's what I was afraid of. Thanks for asking my question at least. :)

Would be useful if the input object was available universally through the registry or something... oh well.
 

Mike

XenForo developer
Staff member
#4
The model is supposed to be independent of user input (and assumed state, as much as possible). So ideally, you'd want to pass in the data you need.

Strictly speaking, you can just create a new request object and give it to a new input object (or an array for a new input object).