symfony-users  

[symfony-users] Re: Generate absolute URL for upload directory

Mo Mughrabi
Thu, 23 Jul 2009 09:57:52 -0700

Thanks Eno,

I found a way which helped me return the absolute url for any location i
need through the public_path helper.

First i had to include the helper through the getConfigurations

sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url'));

and then just use the public_path('uploads/file.jpg');





On Thu, Jul 23, 2009 at 7:52 PM, Eno <symb...@gmail.com> wrote:

>
> On Thu, 23 Jul 2009, Mo Mughrabi wrote:
>
> >    I was trying to generate an absolute URL inside my form classes using
> > sfContext::getInstance()->getController()->genUrl(); but apparently
> genUrl
> > only can be used when supplied a route or module/action but i cannot get
> it
> > to return the absolute path of my uploads folder. Any idea how can i do
> > that?
>
> We never found a good solution for this (we run across a cluster where we
> need absolute and cross-domain links). Now we are using the
> sfDomainRoutePlugin to give us this functionality in url_for() and
> link_to().
>
>
>
> --
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---