protected function _methodRoute($method, $template, $target, $name)
    {
        if ($name !== null) {
            $name = $this->_namePrefix . $name;
        }
        $options = [
            '_name' => $name,
            '_ext' => $this->_extensions,
            '_middleware' => $this->middleware,
            'routeClass' => $this->_routeClass,
        ];

        $target = $this->parseDefaults($target);
        $target['_method'] = $method;

        $route = $this->_makeRoute($template, $target, $options);
        $this->_collection->add($route, $options);

        return $route;
    }
protected function _methodRoute($method, $template, $target, $name)
    {
        if ($name !== null) {
            $name = $this->_namePrefix . $name;
        }
        $options = [
            '_name' => $name,
            '_ext' => $this->_extensions,
            '_middleware' => $this->middleware,
            'routeClass' => $this->_routeClass,
        ];

        $target = $this->parseDefaults($target);
        $target['_method'] = $method;

        $route = $this->_makeRoute($template, $target, $options);
        $this->_collection->add($route, $options);

        return $route;
    }
protected function _methodRoute ( $ method , $ template , $ target , $ name ) { if ( $ name !== null ) { $ name = $ this -> _namePrefix . $ name ; } $ options = [ '_name' => $ name , '_ext' => $ this -> _extensions , '_middleware' => $ this -> middleware , 'routeClass' => $ this -> _routeClass , ] ; $ target = $ this -> parseDefaults ( $ target ) ; $ target [ '_method' ] = $ method ; $ route = $ this -> _makeRoute ( $ template , $ target , $ options ) ; $ this -> _collection -> add ( $ route , $ options ) ; return $ route ; }
Helper to create routes that only respond to a single HTTP method.

@param string $method The HTTP method name to match.
@param string $template The URL template to use.
@param array $target An array describing the target route parameters. These parameters
should indicate the plugin, prefix, controller, and action that this route points to.
@param string $name The name of the route.
@return \Cake\Routing\Route\Route
Helper to create routes that only respond to a single HTTP method .