Phlyty\Route::allowMethod PHP 메소드

allowMethod() 공개 정적인 메소드

Add an HTTP method you will allow
public static allowMethod ( string $method ) : void
$method string
리턴 void
    public static function allowMethod($method)
    {
        $method = strtoupper($method);
        if (in_array($method, static::$allowedMethods)) {
            return;
        }
        static::$allowedMethods[] = $method;
    }

Usage Example

예제 #1
0
파일: AppTest.php 프로젝트: phly/phlyty
 public function testCanSpecifyAdditionalMethodTypesToRespondTo()
 {
     Route::allowMethod(__FUNCTION__);
     $map = $this->app->map('/:controller', 'bogus-callback');
     $map->via(__FUNCTION__);
     $this->assertTrue($map->respondsTo(__FUNCTION__));
 }