To get the base URL in your controller just call
$baseUrl = $this->base
That will give you the base URL and set it in $baseUrl
To get the absolute URL for your project you can call
$_SERVER['HTTP_HOST']
Now to combine it simple append the two to get the full absolute path which can be used to reference images in emails or whatever you like.
'http://'.$_SERVER['HTTP_HOST'].$this->base
By PHPin24 @ 2009-08-11 11:01:35
|