route vs redirect |
[eluser]cotejf[/eluser]
Hey guys, I was thinking that route was a way to give another name to a page. Code: My route: The function: Code: function filtre($null = array()){ I wanted to use it as a fancy url but it wont work. The param I get in my function is 'portable_apple' instead of 'c:10010201/t:prix_descendant/m:z00201' Is there a way using the route to call a controller/method and keep the fancy url? Thanks
[eluser]Migranux[/eluser]
Hello, Code: $route['portables_apple'] = "catalogue/filtre/c:10010201/t:prix_descendant/m:z00201"; Code: $route['portables_apple'] = "catalogue/filtre/10010201/prix_descendant/z00201"; Code: function filtre($null = array()){ Code: function filtre($param1, $param2, $param3){
[eluser]cotejf[/eluser]
mmhh... my function is already working. I use this technique because I can have from 1 to X parameters. I can call Code: catalogue/filtre/c:10010201/t:prix_descendant/m:z00201/w:apple/w:imac/w:20 My concern is the missing parameters pass to the function.... Thanks!
[eluser]Migranux[/eluser]
Sorry $this->uri->segment_array() can't give you the informations, because it is only for the URI in your case portables_apple... But you cn use this function : Code: function filtre($parameters = array()) {
[eluser]Aken[/eluser]
There are methods for retrieving the after route, rather than the one shown. http://ellislab.com/codeigniter/user-gui...s/uri.html
[eluser]cotejf[/eluser]
@Migranux Thanks man! That's perfect and working now! @Aken Thanks Aken, I did not know these functions and they will be usefull to me right now. Thanks again guys. |
Welcome Guest, Not a member yet? Register Sign In |