Read the latest web development and design tips at Fred Wu's new blog! :-)
Poke me on GitHub

Say you make a model that returns a single value such as the name of a user. Might be an idea to plan ahead just in case you need to return multiple results.

eg.

$name = $this->user->get_name($id)->real_name

better than

$name = $this->user->get_name($id)

because what if we need something else later like a nickname?

$name = $this->user->get_name($id)->nickname

  • Digg
  • DZone
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Related posts

Comments Section

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>