Given that CodeIgniter is a MVC framework implies that output code should generally be avoided in anything other than the V part of it all.
There are some cases where it might be okay to put output directly from the controller, but where possible it should all be done as part of a view.
Developing mostly on Ubuntu 14.04 in a VM. Probably insane, but it works.