djp1988 Posted October 18, 2009 Report Share Posted October 18, 2009 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 More sharing options...
Synook Posted October 18, 2009 Report Share Posted October 18, 2009 (edited) 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. Edited October 18, 2009 by Synook Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now