probably this is a quick one, but I can't get my head around right now.
I have the following problem using unnamed optional parameters. Let's say I have the following a action in a controller with two fixed and two optional parameters:
function action ($param1, $param2, $param3=NULL, $param4=NULL) {
//any code
}
$param3 and $param4 can exist both, none or one of the two. Everything works fine if either none, all four or the first three parameters are set. e.g.
www.domain.com/controller/action/value1/value2/value3/
The problem comes up, if param3 is left out
www.domain.com/controller/action/value1/value2//value4/
Is there are way to tell Cake to handle the // between param2 und param4 as a unset param3? Currently the paramters are assigned to "wrong" variables.
$param1= value1
$param2= value2
$param3= value4
$param4= NULL
What I want to have is the following
$param1= value1
$param2= value2
$param3= NULL
$param4= value4
Any help here is highly appreciated.
Thanks a lot guys..
Best, Sebastian