php - Where to set module specific global variables and how -
I am creating some big applications using Kohana 3.1. Like the definitions, I am trying to set the module-wide variable with some key = key => Values.
To give an example, if it was a user module, then I could get the available profiles like
$ profile = array ('user' = & gt; array (' ('Desc' = & gt; 'normal user', 'access' =>,' 1 '),' zonohoe '=> array (' desc '= & gt;' user is not logged ',' access' = ' > 0)); and use $ profiles on all your modules, but not outside. Should I set it in init.php? If so, then how?
Use protected assets in your module class.
protected profile = array (); Somewhere in the module:
$ this-> Profile = Array ('user' = & gt; array ('desc' = & gt; general user ',' access '= & gt;' 1 '),' jonhhooya '= & gt; array (' desc '=' & Gt; 'user not logged', 'access' => 0)); And you can only access this category from the module class or its child-sections.
Comments
Post a Comment