dispatch() публичный статический Метод

Runs the callback for the given request
public static dispatch ( )
Пример #1
0
 private function dispatch()
 {
     $routes = BASE_PATH . '/app/routes.php';
     if (file_exists($routes)) {
         require $routes;
     }
     Route::dispatch();
 }
Пример #2
0
<?php

/**
 * Created by PhpStorm.
 * User: huxiuchang
 * Date: 15-9-17
 * Time: 下午1:38
 */
use NoahBuscher\Macaw\Macaw;
Macaw::get('', 'HomeController@home');
Macaw::get('test', function () {
    echo "成功!";
});
Macaw::$error_callback = function () {
    throw new Exception("路由无匹配项 404 Not Found");
};
Macaw::dispatch();
Пример #3
0
 public function run($baseNamespace = null)
 {
     if ($this->runningInConsole()) {
         return $this->runCall($baseNamespace);
     } else {
         require static::$data_root . '/conf/routes.php';
         Route::error(function () use($baseNamespace) {
             return $this->runCall($baseNamespace);
         });
         Route::dispatch();
         //return $this->runCall($baseNamespace);
     }
 }
Пример #4
0
 public function run()
 {
     Route::dispatch();
 }