Jump to content

evandixon

Clients
  • Posts

    81
  • Joined

  • Last visited

  • Days Won

    2

Community Answers

  1. evandixon's post in Displaying Text in Condensed Activity View was marked as the answer   
    Found the issue. \IPS\Content::searchResultSummaryLanguage is what adds that text, and the core system template "searchResult" only displays that if there's a container. So I need a container.
    After doing the bare minimum to get containers implemented, rebuilding the search index because the lack of containers was cached, and after fixing some undefined language stuff, it works:

  2. evandixon's post in Model vs. Controller was marked as the answer   
    From my limited experience using MVC, generally the controller is the thing responsible for interacting data over HTTP, and the model is only concerned with things related to the model and with exposing methods so that the controller can do what it needs with the model. This also helps from an automated testing perspective, because indirect inputs such as form data is a pain to set up.
    That said, I definitely see the appeal of parsing form values in only one place when there are two controllers that would be doing it. Because first party applications do parse form values in the model (in a method called "processForm" IIRC), it doing the same wouldn't be out of place. Also this helps prevent code duplication.
    Because neither way is wrong per se, it's up to you. I'm personally leaning towards having it in the model, since I would prefer avoiding code duplication over optimizing pure separation of logic. (Even though it feels wrong to intentionally disregard OOP best practices.)
×
×
  • Create New...