The base URL is the part that sits between the host name and index.php in
your URL. If your page is at http://localhost/controller/action, it gets
rewritten into http://localhost/index.php/controller/action by the webserver
before being passed to PHP, so your base URL is rightfully blank. If you're
not using mod_rewrite, you'd typically access your app via
http://localhost/public/index.php/controller/action. In this case, the base
URL would be '/public'.

   -- Mon


On Tue, Dec 16, 2008 at 2:44 PM, novastorm <jonyn...@gmail.com> wrote:

>
> >So I think you do not need to set an base url.
> You are right, I don't need to then.
>
> Let me provide more information. I use the following function to
> get my Url:
>
>    public function getUrl($action = null, $controller = null)
>    {
>        // At this point, $url is nothing
>        $url  = rtrim($this->getRequest()->getBaseUrl(), '/') . '/';
>       // Now, $url becomes "//index" if I'm e. g. at the front page
>        $url .= $this->_helper->url->simple($action, $controller);
>        return $url;
>    }
>
> The problem I have is that $this->getRequest()->getBaseUrl() never
> returns anything and I don't understand why.
>
> --
> View this message in context:
> http://www.nabble.com/Why-isn%27t-this-working--tp21017887p21028094.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to