Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = $_SERVER['REQUEST_URI'];
- $array = explode("/", $url);
- $action = 'index';
- $dispatch = new $array[1];
- if(method_exists($dispatch, $action))
- {
- call_user_func_array(array($dispatch, $action), $args);
- }
- /** Controller object to be found in another file but here for example purposes **/
- class Blog_Controller extends Controller
- {
- /** $postReference would be where $args in the example
- * above is employed
- **/
- public function viewPost($postReference)
- {
- }
- }
Add Comment
Please, Sign In to add comment