I'm building an application that, from the information the user sends me in a GET I'll execute a function. EX:
//classe
class Page extends CI_Controller {
public class index($param){
//aqui estou procurando algo semelhante a $this->"$param"();
}
private class foo(){ echo 'foo'; }
private class bar(){ echo 'bar'; }
}
From the example above, if my user sent to the index('foo')
function he would have to execute the $this->foo()
function. Could someone show me how I can do my function index()
execute another function depending on the parameter sent?