Click here to Skip to main content
16,019,018 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I had one php class in namespace App\Http\Lib as GISApplication which contains static data members. I want to set & access values of that static data members from different classes outside of namespace. How Can I set & access that values.

<?php
namespace App\Http\Lib; 

class GISApplication
{
public static $LOGINUSER_TYPE;
public static $USERMODULE;

// More Static Data Members

}


Suppose I want to set values of these members from LoginController class in App\Http\Controllers namespace & access that values from different classes in App\Http\Operations namespace.

Please suggest.

What I have tried:

I set values from LoginController class in App\Http\Controllers namespace AS
GISApplication::$LOGINUSER_TYPE = $auth->type;
GISApplication::$USERMODULE = $auth->module;


When I access values from FrontOperation class in App\Http\Operations AS
GISApplication::$LOGINUSER_TYPE

I will getting blank value.
Posted
Updated 27-Jan-17 0:31am
v2
Comments
isheraz 5-Apr-18 11:09am    
Did you find a solution to this problem ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900