選択できるのは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. }