On Wed, Jan 20, 2010 at 10:16 PM, thomaus <[email protected]> wrote:
> Anybody a clue?
>
> On Jan 19, 10:28 am, thomaus <[email protected]> wrote:
>> Hi,
>>
>> In my Javascript, I need to use full paths 
>> (e.g.http://localhost/MySite/controller/action)
>> instead of relative URLs (e.g. controller/action), otherwise the
>> actions calls they don't work.
>>
>> Is there something I can do about that?


in your controller:
$this->set('path', 'var path = "' . $this->webroot . '/' .
$this->params['controller'] . '/' . $this->params['actions'] . '";';

in your view:
echo $javascript->codeBlock($path);

-- 
regards,
gedex

blog: http://gedex.web.id

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to