Welcome Guest, Not a member yet? Register   Sign In
URIs and optional parameters
#1

[eluser]adrian westlake[/eluser]
Hi,

Just starting to write my first commercial application in CI, but have a questions regarding the segment url format as opposed to the traditional query string.

What if I have a function with two optional parameters. In other words each one has a default value if not passed.

Code:
function myFunction($param1 = "default", $param2 = "default"){

}

With the traditional GET method it is fine as it associates the keys and values.

But with the segment method if I passed

Code:
www.mydomain.com/controller/function/param

How would I know if the param was for the first or second optional parameter. In other words I have to pass all parameters for a function to ensure I know which is which. Does that make sense???


Messages In This Thread
URIs and optional parameters - by El Forum - 07-12-2007, 05:33 AM
URIs and optional parameters - by El Forum - 07-12-2007, 08:40 PM
URIs and optional parameters - by El Forum - 07-16-2007, 02:04 AM
URIs and optional parameters - by El Forum - 07-16-2007, 02:59 AM
URIs and optional parameters - by El Forum - 07-16-2007, 03:04 AM
URIs and optional parameters - by El Forum - 07-16-2007, 04:22 AM
URIs and optional parameters - by El Forum - 07-16-2007, 04:34 AM
URIs and optional parameters - by El Forum - 07-16-2007, 04:46 AM
URIs and optional parameters - by El Forum - 07-16-2007, 05:04 AM
URIs and optional parameters - by El Forum - 07-16-2007, 05:10 AM
URIs and optional parameters - by El Forum - 07-17-2007, 06:48 PM
URIs and optional parameters - by El Forum - 07-18-2007, 02:53 AM
URIs and optional parameters - by El Forum - 10-25-2007, 07:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB