Hi

Need some advice - Ive been going more and more OO in my coding, just coming into some best-practice issues...

Lets say I have a User object, and the user has some contact details... whats preferential, to call the getUserDetails() and include the layout HTML in that method, or to call getUserDetails() and have it return an array and then do the layout on the page, outside of a method?

Or is there a third option?

Recommended Answers

All 3 Replies

sorry, OOP design and layout :)

return . really always separate cat and mice :) . . its nicer to look at .

I would suggest you read above the MVC pattern, as it may well help you to decide things like this in the future.

Zend, and Symfony are examples of PHP frameworks which implement MVC. Perhaps you should give them a look :)

R.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.