think\Route::delete PHP Method

delete() public static method

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

Usage Example

Example #1
0
 public function testRegister()
 {
     Route::get('hello/:name', 'index/hello');
     Route::get(['hello/:name' => 'index/hello']);
     Route::post('hello/:name', 'index/post');
     Route::put('hello/:name', 'index/put');
     Route::delete('hello/:name', 'index/delete');
     Route::any('user/:id', 'index/user');
     $this->assertEquals(['type' => 'module', 'module' => [null, 'index', 'hello']], Route::check('hello/thinkphp'));
     $this->assertEquals(['hello/:name' => ['route' => 'index/hello', 'option' => [], 'pattern' => []]], Route::getRules('GET'));
     Route::register('type/:name', 'index/type', 'PUT|POST');
 }
All Usage Examples Of think\Route::delete