passing a url as a param in a Laravel 4 Route -


i want pass url part of route: i.e

http://example.com/param1/url_param

or

http://example.com/param1/?url_param=http://example1.com/56474

route::get('/{param1}/{url_param?}', function($param1, $url_param){});  

i'm on ubuntu, nginx, laravel 4.

you should not pass url without encoding via parameter. furthermore, cannot pass in first example (appending segment of url) have segment delimiter char inside url ('/') define protocol.

the second example right though, although i'd recommend encode url using url_encode().

another approach encode url using b64, producing string can appended url segment. like:

$urltobeappended = base64_encode( 'http://example1.com/564740' ); 

and final route like:

http://example.com/param1/ahr0cdovl2v4yw1wbguxlmnvbs81njq3nda=

in controller responsible handling route can decode b64 string.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -