Separate out your controller code from view code. A few ways to do that,
most points for using a templating framework like https://github.com/bobthecow/mustache.php
This will also make some of the HTML generation a lot less klunky.
But at the least create some classes and put logic in there, and reference that in the html renderers.
Separate out your controller code from view code. A few ways to do that, most points for using a templating framework like https://github.com/bobthecow/mustache.php This will also make some of the HTML generation a lot less klunky. But at the least create some classes and put logic in there, and reference that in the html renderers.