Welcome Guest, Not a member yet? Register   Sign In
NULL parameters in controller method
#1

[eluser]Unknown[/eluser]
Let's say I have a method like this:

Code:
function search($query=NULL, $limit=5, $offset=0)
{

}

Now, if nothing is passed to $query it messes up my URL structure. I could make it $query=0, but then I would have an unnecessary 0 in my URL.

Is there another way to do this?




Theme © iAndrew 2016 - Forum software by © MyBB