Recipe for mixed segments/querystring |
[eluser]edoornav[/eluser]
Hi, I'd like to be able to use mixed segments/querystrings in my urls like this: http://mydomain.com/mycontroller/mymetho...bar=param3 I've read all of the relevant threads discussing how this might be done, tried many combinations of config values and rewrite rules and still don't seem to be able to get it to work. Does anyone have a simple recipe to reliably get this to work. I would really be grateful. ~ryan
[eluser]xwero[/eluser]
Is there a reason why you don't want to use an url like http://mydomain.com/mycontroller/mymetho...bar/param3 ?
[eluser]obiron2[/eluser]
you would want to do it the first way if you had an unknown number of parameters. I had a similar problem with an ajax enabled page that needed to pass an inderterminate number of data pieces back to the controller as part of its URL. I took my Javascript DOM Object and serialised it, then ran it through URLencode() - I had to run it twice for some reason, and then URLunencode()ed it and then unserialised it in the controller. You could do the same, build your ? string and then urlencode it, and then play with it in the controller. Not nice, but easy to implement and reliable. obiron
[eluser]edoornav[/eluser]
[quote author="xwero" date="1193139221"]Is there a reason why you don't want to use an url like http://mydomain.com/mycontroller/mymetho...bar/param3 ?[/quote] Yes. I'm developing a facebook app. In facebook applications, most requests are posted, and facebook's vars are sent as POST variables. When you use an iframe, it makes a GET request instead, and sends the facebook variables in the querystring. With facebook, myspace, high5 and other social networking sites opening to application developers, this sort of thing should become much more common. I don't think frameworks can make the same assumptions they used to be able to make. ~ryan
[eluser]Nathan Pitman (Nine Four)[/eluser]
Hi Ryan, did you ever find a workable solution to your problem? I also need to be able to receive a URL with a querystring in my app but it is currently coded using the segment approach and I'd rather not have to change everything! ![]() |
Welcome Guest, Not a member yet? Register Sign In |