I have a form and the url for submitting the form will generated dynamicly
var Var1 = new Array();
var Var2 = new Array();
if(Var1.length === 0)
$(this).attr('action', 'http://localhost/Method' ).submit();
if(Var1.length != 0 && Var2.length === 0)
$(this).attr('action', 'http://localhost/Method/Var1').submit();
if(Var1.length != 0 && Var2.length != 0)
$(this).attr('action', 'http://localhost/Method/Var1/Var2').submit();
and all that URLs fires one method in the server and it is
public function Method(){}
public function Method(Var1){}
public function Method(Var1 , Var2){}
is there anyway to make all the last 3 methods as one method? something like this:
public function Method(Var1, Var2){
if( condition for Var1 ){// doSomthing}
if( condition for Var2 ){// doSomthing}
}