I am trying to get my site running using the MVC approach.
I have a parent class called BaseController. All other contoller classes inherit from it.
When you go to http://example.com/home/index the HomeComtroller loads properly (a child of BaseController).
Where I am stuck is having HomeController executing its methods.
The URL set up is ?controller=nameofclass&action=nameofmethod&id=someidgoeshere, with mod_rewrite handling the URL.
I use $_GET to identify the method to be executed, by calling $this->action(); which in theory should automatically execute a method with the corresponding name. And it works -- only thing is, it is looking for a method inside the parent class instead of the child class to execute.
Is there a way to pass the $this->action() to my child class and have the child class execute the specified method?
I do have all of this in the parent constructor, but even when I call this->action() from a child class, it still searches the parent class for the method.
Thank you for your time!