Pass url parts as array to controller |
[eluser]Unknown[/eluser]
Best, I was wondering if it is possible to pass the whole url in array form to the called controller method. so for example if I call Code: /controller/action/param1/param2/param3 Code: public function action($param1, $param2, $param3) But rather Code: public function action($params) This because I do not know in advance how many parameters will be passed through. Thanks! Pj
[eluser]mschinis[/eluser]
you can use: Code: $this->uri->uri_to_assoc(n) that will give you an associative array back. Refer to this page: http://ellislab.com/codeigniter/user-gui...s/uri.html
[eluser]Unknown[/eluser]
Hey mschinis, uri_to_assoc wasn't exactly what I was looking for but on the page you provided I found the function Code: $this->uri->segment_array() That did the job. Thanks!
|
Welcome Guest, Not a member yet? Register Sign In |