December 11th, 2024
Posted by scotti3g
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
Leave a Reply