Codeigniter,没有提供参数?

Could someone tell what to do when you have a method like this:

class Start extends CI_Controller
{
    function foo($name)
    {
        //do something... 

    }
}

and the user of the website don't pass any parameters, e.g. when typing this in the address bar: website/controller/foo/(no $name parameter).

I want to show a different view when this happens, but i don't how to check for this.

PS. I know you can use $this->uri->segment(); instead of parameters, but i would prefer not to.

Thanks

Set the default value of $name to NULL and check whether it's set:

function foo($name = NULL)
{
    if(isset($name))
    {
        // Do something with $name
    }
    else
    {
        // $name not set
    }

}