Urlencoded url() parameter

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Urlencoded url() parameter

Oscar Fanelli
I tried to pass 'try/myword/try' as a parameter of a route, but when i call the route (from a view) with

url('route', array(' param' => 'try/myword/try'))

i get something "urlencoded" (blablabla.com/try%2F/%2F)

Is there a way to not urlencode it?
Maybe some $options to pass to the assemble() function of the route?

Thanks

---


Oscar Fanelli
Fondatore Gamempire.it
Email secondaria: [hidden email]
Skype: gamempire
Tel: 3388696167

Reply | Threaded
Open this post in threaded view
|

Re: Urlencoded url() parameter

Jurian Sluiman
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Urlencoded url() parameter

Oscar Fanelli
This is a real so nice custom route :) I think it will help me in some problems (and certainly will solve the "urlencode()" problem)!

Thanks so much

---


Oscar Fanelli
Fondatore Gamempire.it
Email secondaria: [hidden email]
Skype: gamempire
Tel: 3388696167

Il giorno 23/set/2012, alle ore 11:50, Jurian Sluiman <[hidden email]> ha scritto:

Hi Oscar

2012/9/22 Oscar Fanelli <[hidden email]>
I tried to pass 'try/myword/try' as a parameter of a route, but when i call the route (from a view) with

url('route', array(' param' => 'try/myword/try'))

i get something "urlencoded" (blablabla.com/try%2F/%2F)

Is there a way to not urlencode it?
Maybe some $options to pass to the assemble() function of the route?

This is hard-coded into the route. For example, the segment route urlencode()s all parameters during assembly [1]. In a discussion with Ben Scholtzen (DASPRiD) in May he indicated that optional urlencoding of route parts will not be a feature of (at least) the segment route.

If you keep slashes this way, you get problems because segments later in that route and child routes cannot be matched correctly anymore. Therefore it is always a last route part (and thus I called it "CatchAll").

I have had a similar issue for ensemble and I solved this with a custom route [2] which I appended as child_route to my route requiring this feature [3]. Hope that might help.


PS. I see you have a route segment called "route". If you want to have a sub part that matches in a second router, check EnsembleAdmin where I have done the same thing. This might give you a kickstart when you try to combine the CatchAll route with a second router: https://github.com/ensemble/EnsembleAdmin
--
Jurian Sluiman