1. 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

Discussion in 'XenForo Development Discussions' started by digitalpoint, Oct 23, 2011.

  1. digitalpoint

    digitalpoint Well-Known Member

    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.
  2. vbresults

    vbresults Well-Known Member

    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 likes this.
  3. digitalpoint

    digitalpoint Well-Known Member

    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.
  4. Mike

    Mike XenForo Developer Staff Member

    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).

Share This Page