[eluser]TWP Marketing[/eluser]
Do your formatting in a model, or in the controller and only send the formatted data to the view.
However, sometimes you must put php processing in a view, for instance a foreach() loop to write a list or html table. The code police will not be overly upset with this, because they do it themselves, sometimes...