有没有办法在Codeigniter控制器中创建2个函数,其中一个函数包含参数而另一个函数不包含参数.我使用下面的代码,它给了我一个错误.
class example extends CI_Controller {
function show() {
#code goes here
}
function show($id) {
#code goes here
}
}
Run Code Online (Sandbox Code Playgroud)
但是它显示了一个错误,函数名称不能相同.