I need to concatenate the base url with another variable which should be public in the class. How can I do this?
Here is my code :
class site extends CI_Controller
{
public $site_favicon = base_url().'img/favicon.ico';
// I tried even public $site_favicon = base_url();.'img/favicon.ico';
}
Where i will call the variable $t publicly any where from the site.
How can i do this ?
This is how I will call:
<link rel="shortcut icon" href="<?php echo $this->site_favicon; ?>">
I am getting:
Parse error: syntax error, unexpected '(', expecting ',' or ';' in /opt/lampp/htdocs/ci/application/controllers/site.php on line 23
What mistake am I doing in concatenation and how can i fix this?
$site_favicon?