php - CodeIgniter uri's - how to get multiple values? -


i using form submit filter parameters view. there multiple filters can selected, , filters multi-selects.

however, prefer use post-redirect-view method, means have translate post data uri segments.

with in mind, going use $this->uri->uri_to_assoc(n) method. however, not sure how working if of parameters can have multiple values.

the method can think of join values each key unique character (say ‘—’), use $this->uri->uri_to_assoc(n) parse each key-value pair, , explode() each of values (on ‘—’) again. best way it?

in addition, how on issue 1 of values may have forward slash (’/’) in name?

example:

i have multi-select (named categories[]) posted , used filter parameters. user select 2 values multiselect: 'jim/bob' , 'sarah'. controller receives post, $this->input->post('categories') gives me array. want redirect same controller , use values $this->input->post('categories') parameters in uri. /controller/method/categories/abc abc categories selected.

where

this case using "get" form method. you're not receiving input user, user querying information. post-redirect-get pattern isn't relevant in context.

use query string ;)


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -