Symfony\Component\HttpFoundation\Request::isMethodCacheable PHP 메소드

isMethodCacheable() 공개 메소드

Checks whether the method is cacheable or not.
또한 보기: https://tools.ietf.org/html/rfc7231#section-4.2.3
public isMethodCacheable ( ) : boolean
리턴 boolean
    public function isMethodCacheable()
    {
        return in_array($this->getMethod(), array('GET', 'HEAD'));
    }

Usage Example

예제 #1
0
 /**
  * @dataProvider methodCacheableProvider
  */
 public function testMethodCacheable($method, $chacheable)
 {
     $request = new Request();
     $request->setMethod($method);
     $this->assertEquals($chacheable, $request->isMethodCacheable());
 }