PHP Object Oriented Web Application
Posted
by Sev
on Stack Overflow
See other posts from Stack Overflow
or by Sev
Published on 2010-05-26T03:10:56Z
Indexed on
2010/05/26
4:31 UTC
Read the original article
Hit count: 239
php
|object-oriented-design
I have a class called "Layout" for the layout of the page, another class called "User" for the user.
Every page I create, I instantiate a new Layout.
When a user logs in, there is a new User instantiated.
How do I get an instance of the layout class to know about the instantiated user? I could also save the entire instance of the User in a session variable. I assume that's a bad idea though. What are the best practices for this?
© Stack Overflow or respective owner