src/OptionsAction.php
public function run($id = null)
    {
        $app = $this->getApp();
        if ($app->getRequest()->getMethod() !== 'OPTIONS') {
            $app->getResponse()->setStatusCode(405);
        }
        $options = $id === null ? $this->collectionOptions : $this->resourceOptions;
        $app->getResponse()->getHeaderCollection()->set('Allow', implode(', ', $options));
        $app->getResponse()->getHeaderCollection()->set('Access-Control-Allow-Method', implode(', ', $options));
    }
public function run($id = null)
    {
        $app = $this->getApp();
        if ($app->getRequest()->getMethod() !== 'OPTIONS') {
            $app->getResponse()->setStatusCode(405);
        }
        $options = $id === null ? $this->collectionOptions : $this->resourceOptions;
        $app->getResponse()->getHeaderCollection()->set('Allow', implode(', ', $options));
        $app->getResponse()->getHeaderCollection()->set('Access-Control-Allow-Method', implode(', ', $options));
    }
public function run ( $ id = null ) { $ app = $ this -> getApp ( ) ; if ( $ app -> getRequest ( ) -> getMethod ( ) !== 'OPTIONS' ) { $ app -> getResponse ( ) -> setStatusCode ( 405 ) ; } $ options = $ id === null ? $ this -> collectionOptions : $ this -> resourceOptions ; $ app -> getResponse ( ) -> getHeaderCollection ( ) -> set ( 'Allow' , implode ( ', ' , $ options ) ) ; $ app -> getResponse ( ) -> getHeaderCollection ( ) -> set ( 'Access-Control-Allow-Method' , implode ( ', ' , $ options ) ) ; }
Responds to the OPTIONS request.
@param string $id
Responds to the OPTIONS request .