Correct way to overload a method in codeigniter/php:
function mymethod($id = null)
{
if (isset($id))
{
echo "My method with one parameter";
}
else
{
echo "My method with no parameters";
}
}
The above method can be invoked by:
mymethod();
mymethod(true);