-- Jigal sanders <[email protected]> wrote
(on Tuesday, 08 December 2009, 06:17 PM +0100):
> It's running like this
> http://sites/events/add

Assuming "events" is the name of a controller, baseUrl() should
correctly return an empty string.

> What I did to solve the problem is I added two lines in my bootstrap.php
> 
> $controller = Zend_Controller_Front::getInstance();
>  $controller->setBaseUrl('/var/www/nrka/public');
>
> But I don't know if that's the right way to solve it.
> Can't i change it in my app.ini file?
> If so, how?

    resources.frontcontroller.baseUrl = "..."

However, what you're describing is an absolute path on your filesystem
-- not the base path as accessed via the web server (which is what
baseUrl()) is for. Based on your original post you want the latter (a
path relative to the host); simply do:

    
$this->jQuery()->setLocalPath($this->baseUrl('js/jquery/js/jquery-1.3.2.min.js'));

and that will return an appropriate URL. Just make sure that 'js' is a
subdirectory under "public".

> On Tue, Dec 8, 2009 at 3:26 PM, Matthew Weier O'Phinney <[email protected]>
> wrote:
> 
>     -- Jigal sanders <[email protected]> wrote
>     (on Tuesday, 08 December 2009, 11:36 AM +0100):
>     > For some reason my baseUrl stays empty.
>     >
>     > When i do
>     >             
> $this->jQuery()->setLocalPath($this->baseUrl().'js/jquery/js/
>     > jquery-1.3.2.min.js')
>     >
>     > Then my baseurl stays empty
>     >
>     > any idea's?
> 
>     baseUrl() will return an empty string if your application is running
>     directly out of the document root; it will only be populated if you're
>     running it out of a subdirectory or appending path information to a
>     file:
> 
>        /foo/zfapp/controller/action -> /foo/zfapp would be baseUrl()
>        /app.php/controller/action -> /app.php would be baseUrl()
> 
>     --
>     Matthew Weier O'Phinney
>     Project Lead            | [email protected]
>     Zend Framework          | http://framework.zend.com/
> 
> 
> 
> 
> --
> Met vriendelijke groet,
> 
> Jigal Sanders
> A.J. Ernststraat 739
> 1082 LK Amsterdam
> Mobiel: 06-42111489

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/

Reply via email to