For a project I'm working on, I'm trying to call a method using a property
$this->action = "home";
$action = $this->action;
$this->$action();
Is there a shorter way to do this? I tried the following, but it won't work:
$this->action = "home";
$this->$this->action();
So I want to set the $action property, and then call the method that has the same name as $action.