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

Model to interpret data

Discussion in 'XenForo Development Discussions' started by Valhalla, May 29, 2014.

  1. Valhalla

    Valhalla Well-Known Member

    Should I use a Model to interpret (manipulate) data in addition to fetching it, or should I fetch from the Model, return it, and manipulate elsewhere?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Models can often be used to manipulate and prepare data too.

    Depends exactly on the scenario, but it is done in XenForo in many places. Whether it be unserialising data before its sent to a template or setting additional flags or checking and adjusting the data based on permissions etc.
     
    Valhalla likes this.

Share This Page