Re: accessing variable from inside a class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I cant get it to work. I will use a configuration class instead.

function templateParser($templateFile='default_template.htm')
	{
		$c = new config();
		(file_exists($c->template_dir.$templateFile)) ? 
			$this->output=file_get_contents($c->template_dir.$templateFile) 
			:
			die('Error:Template file '.$template_dir.$templateFile.' not found');
	}


/Lars

fre, 04 09 2009 kl. 14:49 -0700, skrev James Colannino:
> Lars Nielsen wrote:
> > Hi,
> > 
> > How do i access a variable from inside a class?
> 
> Add the following statement:
> global $template_dir;
> 
> James
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux