loading method based on URL
- by steeped
I am trying to build a small mvc-based application.
How do I call a method in a class based on a query string?
For example, the $_GET query string is being set as load_master_form
http://www.domain.com/settings/load_master_form
And to call the method within the settings class, I am doing:
function __construct(){
$this->{$_GET['method']}();
}
But obviously that doesn't work - it just isn't possible to load a method like that. So how would it be done?