think\Route::get PHP Method

get() public static method

注册GET路由
public static get ( string $rule, string $route = '', array $option = [], array $pattern = [] ) : void
$rule string 路由规则
$route string 路由地址
$option array 路由参数
$pattern array 变量规则
return void
    public static function get($rule, $route = '', $option = [], $pattern = [])
    {
        self::rule($rule, $route, 'GET', $option, $pattern);
    }

Usage Example

Example #1
0
 public function testBind()
 {
     $request = Request::instance();
     Route::bind('index/blog');
     Route::get('index/blog/:id', 'index/blog/read');
     $result = Route::check($request, '10');
     $this->assertEquals(['index', 'blog', 'read'], $result['module']);
     Route::bind('\\app\\index\\controller', 'namespace');
     $this->assertEquals(['type' => 'method', 'method' => ['\\app\\index\\controller\\blog', 'read']], Route::check($request, 'blog/read'));
     Route::bind('\\app\\index\\controller\\blog', 'class');
     $this->assertEquals(['type' => 'method', 'method' => ['\\app\\index\\controller\\blog', 'read']], Route::check($request, 'read'));
 }
All Usage Examples Of think\Route::get