I'm writing a plugin for which I'd like to be able to set site-wide preferences via custom variables in config.php (eg $['myplugin_config_item']
), and have those variables available in all my plugins methods, eg:
...
class Myplugin {
public $return_data;
function Method(){
//how do I access $['myplugin_config_item'] here?
}
function Method2(){
//and if I want to access $['myplugin_config_item'] here too, what's the most efficient way to do so?
}
}
...
What's the cleanest/neatest way to do this?