Passing variables to new objects PHP OOP -
i wondering if way in passing variables different objects best way of doing things. have user class handles of information session. within user class variable (private) called isloggedon bool set @ false default. ideally need pass variable onto usermanage class can allow logged on user things such make new posts. here how i'm doing @ moment...
$user = new user(); $usermanage = new usermanage($user->checkloggedon());
so can see have instance of user. within user class have method returns isloggedon variable (checkloggedon()) within user manage knows whether user logged on or not.
please put mind @ ease , tell me whether best approach.
thanks lot
Comments
Post a Comment