I have a couple of methods that are presentation-oriented, and I'm wondering the best place to put them. Currently, they're sitting in the model class. This works and makes them convenient to refer to in the template. However, I'm not so happy putting presentation code in the model. Does anybody have any suggestions about where best to put these methods? I thought perhaps a DataExtension might be a simple way to separate things out.
Here is a simple example:
public function WebsitePrettyFormat() {
return preg_replace (
array("/^http:\/\//i","/\/$/"),
array("",""),
$this->Website
);
}
That's a minor case, but I have another much longer example where a method is generating all the markup for an image carousel, including the CSS and JS requirements.
Any suggestions?