[symfony-users] Re: Generating url for a route with param containing slashes
Le 23 juin 08 à 20:42, Francois Zaninotto a écrit : > how about: > > function link_to_path($text, $uri, $options = array()) > { > $link = link_to($text, $uri, $options); > > return str_replace('%2F', '/', $link); > } > > Still kinda hackish, but since you can't selectively deactivate URL > parameter encoding in symfony... Ok, thanks François. -- Nicolas CHARLOT http://www.isics.fr --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Generating url for a route with param containing slashes
how about: function link_to_path($text, $uri, $options = array()) { $link = link_to($text, $uri, $options); return str_replace('%2F', '/', $link); } Still kinda hackish, but since you can't selectively deactivate URL parameter encoding in symfony... Cheers, François 2008/6/23 Nicolas CHARLOT <[EMAIL PROTECTED]>: > > Hi, > > I'm trying to get the url of a route with a param containing slashes > like "@mypage?slug=foo/bar". > The genUrl() methode of sfWebController encode the param and return : > "/mypage/foo%2Fbar" rather than "/mypage/foo/bar". > > I found a very bad solution in using a "PLACEHOLDER" in place of the > param value and replacing it after the generation. > Another bad pratice is to urldecode the returned url :( > > Any better idea ? > > Best regards, > -- > Nicolas CHARLOT > http://www.isics.fr > > > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Generating url for a route with param containing slashes
Le 23 juin 08 à 15:10, Lee Bolding a écrit : > The only solution I've found is to Base64 encode the URL U mean after generation ? -- Nicolas CHARLOT http://www.isics.fr --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Generating url for a route with param containing slashes
The only solution I've found is to Base64 encode the URL - you get the same problem with the sfExternalLinkTracker plugin. Base64 encoding the URL seems to solve most of these problems. On 23 Jun 2008, at 13:19, Nicolas CHARLOT wrote: > > Hi, > > I'm trying to get the url of a route with a param containing slashes > like "@mypage?slug=foo/bar". > The genUrl() methode of sfWebController encode the param and return : > "/mypage/foo%2Fbar" rather than "/mypage/foo/bar". > > I found a very bad solution in using a "PLACEHOLDER" in place of the > param value and replacing it after the generation. > Another bad pratice is to urldecode the returned url :( > > Any better idea ? > > Best regards, > -- > Nicolas CHARLOT > http://www.isics.fr > > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---