Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

optional parameters in CodeIgniter

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

like image 302
Mala Avatar asked Jan 06 '10 15:01

Mala


1 Answers

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

have you tried this?

like image 110
antpaw Avatar answered Sep 23 '22 06:09

antpaw