Peter
unread,Sep 25, 2011, 3:38:00 AM9/25/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Simple PHP Framework
Im trying to learn more about php by using this framework but running
into a little trouble on understanding how some of this stuff works
and why.
So I have a situation where I want users to be able to edit their
information and update it. This is information like first_name,
last_name, gender, contact_phone, contact_mobile, address, suburb,
city, post_code.
Now I thought best practice would be to use a DbObject User class and
then use the object on the information edit page like so:
$user = new User($Auth->id);
Giving me the ability to echo out the users current details into a
form like so:
echo $user->first_name etc etc.
However I have noticed that the Auth Class already creates the user
object and puts it into $Auth->user;
Why is the Auth Class doing this? Doesn't that mean the Auth class is
adding an extra query to the user database on every page?
Instead should I be using echo $Auth->user->first_name etc etc?
Help in understanding is very much appreciated.
Im also new to the idea of DbObjects and dont have a great
understanding on the purpose apart from the idea of abstraction.