views:

347

answers:

1

Hello

I have installed Kohana in kohana directory in my xampp public folder. When I try

url::base();

I've got only /kohana/, but I want to http://localhost/kohana/

Any chance for get this by Kohana, or I must standard PHP?

Regards

+3  A: 

You don't have to extend anything, just use URL::site with the protocol parameter:

$base_url = URL::site(NULL, TRUE);

This will generate a base URL with the current protocol. If you want to use a specific protocol:

$base_url = URL::site(NULL, 'http');

No need to reinvent the wheel here!

shadowhand
Ah, I learned something. My (wrong) answer wrongfully assumed I had to set it all up in config (which I did for Kohana 2.3)
alex