I am new to MVC (I use codeigniter) and wondered where I should put the cut_description function.
My model receives a list of events, including their description. If the description is too long, I will need to cut it out after the first n words and add a βread moreβ link, so the presentation will not be too cluttered.
What would be the best practice?
- add logic to reduce after n words to the model
- add logic to the controller
- add it to the view?
I think 3 will be easier (I still need to scroll through the results), but I'm not sure if this will be consistent with MVC.
What do you think?
source
share