views:

58

answers:

1

Hi

I'm trying to write a function in a CodeIgniter controller which can take optional parameters. However, I always get Missing Argument warnings. I'm not trying to suppress the warnings - I'm trying to declare the parameters as optional (maybe they could be empty strings if they don't exist, or something).

What is it I'm missing?

Thanks
Mala

+1  A: 
  public function my_optional_test($not_optional_param, $optional_param = NULL)
  { $this->stuff(); }

have you tried this?

antpaw
thanks mate :-)
Mala
note that this is just not in codeigniter but throughout php in case you were wondering
Tom Schlick