Jump to content

Classes : Content And Logic


djp1988

Recommended Posts

Hello, Is there a rule I should follow to make better classes? I am using echo in some of my methods in my class, I just wondered if I was going down the wrong road, I have a method for each page, and call it from a separate php script, in these methods i use echo and output the content while also using the classes other methods and info to keep it all in one place, But someone said to me that really classes shouldn't be used in that way, it should allow you to separate logic from content, or should I say separate output from non-output logic...Any suggestions ?I've started to rewrite my class removing the page specific methods and putting them on their actual page on their own, whil still including the class to access other methods.

Link to comment
Share on other sites

Your correspondent is probably referring to the MVC* / three-tier style of programming. It does make things less confusing.* don't worry about all the frameworks.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...