[eluser]Rahi[/eluser]
Hi,
bclinton's class really did the trick for me. However, I would like to suggest few update for it.
Code:
$classname = ucfirst(substr($filename, 0, strrpos($filename, '.')));
- $controller = new $classname();
- $methods = get_class_methods($controller);
+ //$controller = new $classname();
+ $methods = get_class_methods($classname);
<b>Reasons:</b>
1. There is no need to instantiate the class. We can simply pass class name and it will give us the methods.
2. If controllers are looking for valid sessions, it will keep redirecting you to the login page.
3. In case you are using Matchbox, HMVC, it will not load supporting libraries.
I thought it worth giving my input, but thanks for the kick off.
-Rahi