Phprest\Application::options PHP Method

options() public method

Add a OPTIONS route
public options ( string $route, mixed $action ) : void
$route string
$action mixed
return void
    public function options($route, $action)
    {
        $this->router->addRoute('OPTIONS', $route, $action);
    }

Usage Example

Example #1
0
 public function testOptions()
 {
     $this->app->options('/test-options', 'test-handler');
     $this->assertEquals(['method' => 'OPTIONS', 'route' => '/test-options', 'handler' => 'test-handler'], $this->app->getRouter()->getRoutingTable()[0]);
 }