View Single Post
Old 07-20-2009, 12:32 AM   #4 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Why are you putting display code that is only going to be used in one file in a class? Objects are for core logic and code you want to re-use over and over again. The word "display" in a class almost always means you are doing it incorrectly.

The way I try to look at it is pretending that classes and objects have no access to any sort of HTTP output (echo, print, ect).

Enfernikus, your final way is probably the best method. Just pass the object by reference opposed to value so a new instance is not created.
__________________

Village Idiot is offline  
Reply With Quote
The Following 2 Users Say Thank You to Village Idiot For This Useful Post:
adamdecaf (07-20-2009), hello-world (09-17-2009)