Welcome Guest, Not a member yet? Register   Sign In
Optional parameter for controller
#1

[eluser]JohnDoerther[/eluser]
Hi guys,

I have the following situation: I have a controller at/back/orders/start/15 which would in this case show the 15 latest orders placed.

Now, I created the start method in the controller with 1 parameter. This works great if I actually pass a parameter, but I also want to be able to access /back/orders/start without a parameter (and using a default value of for example 10).

Could you tell me what the cleanest way of doing this is? I have never worked with remap or URI routing, I am not even sure if I need this but a quick Google seems like I might need this.

I tried creating another function start without a parameter but this seems to be forbidden (duplicate function name).

Thanks in advance,


Messages In This Thread
Optional parameter for controller - by El Forum - 07-22-2010, 10:59 AM
Optional parameter for controller - by El Forum - 07-22-2010, 11:22 AM
Optional parameter for controller - by El Forum - 07-22-2010, 11:26 AM
Optional parameter for controller - by El Forum - 07-22-2010, 11:39 AM
Optional parameter for controller - by El Forum - 07-22-2010, 11:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB