optional parameters in CodeIgniter

codeigniter, optional-parameters, php

Solution

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

have you tried this?

Problem

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

Original source