How can I pass the global variables to the classes I want to use without declare them as GLOBAL in every method of the class ?
example :
$admin = "admin_area";
if($_POST['login']){
$user = new Administrator;
$user->auth($pass,$username);
}
in the class Administrator I want the variable $admin be accessible in all methods of the class without doing this :
class Administrator{
public function auth($pass,$user){
global $admin;
.....
}
public function logout(){
global $admin;
.....
}
}