Passing an array through GET while using url_to_assoc |
[eluser]jhyland[/eluser]
Currently, on the website I have now (which will be replaced with the new CI site), there are multi selects and check boxes. So if someone selects two check boxes, or two options in a multi select, the URL looks like this.. http://website.com/?checkbox[]=var1&chec...ti;[]=var2 (Ignore the ';', the forum keeps putting those in there.) That will get processed as this: array( checkbox => array('var1','var2'), multi => array('var1','var2') ); I want to use the $this->uri->uri_to_assoc option in CI, but that only does a single level associative array. How can I accomplish the same task, using the url_to_assoc? Also, how do I have a CI form "action" go to that type of url? Meaning, instead of it going to ?this=that, how do I make it go to /this/that/ ? Thanks!
[eluser]jhyland[/eluser]
How do I have the form post the json code to a URL? And how does CI interpret /something/like/this/ as json?
[eluser]jhyland[/eluser]
You just gave a link to the jquery site... Can you help me out with maybe something more specific?
[eluser]PhilTem[/eluser]
Just make your forms submit GET data and no POST data. Code: echo form_open($action, array('method' => 'GET')); Voila
[eluser]jhyland[/eluser]
Except, the point is to get rid of the ugly url: http://website.com/?checkbox[]=var1&chec...ti;[]=var2
[eluser]jhyland[/eluser]
This works. I modified the URI.php file. Code: function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') The request: http://localhost/index.php/ci/view_asset.../test/true Returns: Quote:Array Hope this helps other people
[eluser]jhyland[/eluser]
This would also entail editing the assoc_to_uri function for redirecting to the uri. Code: function assoc_to_uri($array)
|
Welcome Guest, Not a member yet? Register Sign In |