您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Dispatch.class.php 478B

12345678910111213141516171819
  1. <?php
  2. class Dispatch {
  3. private static $initialized = false;
  4. public static $user;
  5. public static $controller;
  6. public static $action;
  7. public static $args;
  8. public static function route($controller, $action, $args=[]) {
  9. self::$controller = $controller;
  10. self::$action = $action;
  11. self::$args = $args;
  12. $class = self::$controller.'Controller';
  13. $response = call_user_func(array(new $class(), self::$action), self::$args);
  14. return $response;
  15. }
  16. }