How do I get the base URL in Kohana 3?
Is there a solution in raw PHP?
In Kohana it's
echo url::base();
http://docs.kohanaphp.com/helpers/url
In raw PHP
echo "http://".$_SERVER['HTTP_HOST']."/NameOfApp";
For Kohana 3, it's URL::base().
From the doc:
// Absolute URL path with no host or protocol
echo URL::base();
// Absolute URL path with host, https protocol and index.php if set
echo URL::base('https', TRUE);
// Absolute URL path with host and protocol from $request
echo URL::base($request);
Ref.: http://kohanaframework.org/3.1/guide/api/URL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With