Static methods requiring var
- by Charlie Pigarelli
Ok, i'm stuck on this, why don't i get what i need?
class config
{
private $config;
# Load configurations
public function __construct()
{
loadConfig('site'); // load a file with $cf in it
loadConfig('database'); // load another file with $cf in it
$this->config = $cf; // $cf is an array
unset($cf);
}
# Get a configuration
public static function get($tag, $name)
{
return $this->config[$tag][$name];
}
}
I'm getting this:
Fatal error: Using $this when not in object context in [this file] on line 22 [return $this->config[$tag][$name];]
And i need to call the method in this way: config::get()...