Cake\Routing\Route\Route::_matchMethod PHP Method

_matchMethod() protected method

Check whether or not the URL's HTTP method matches.
protected _matchMethod ( array $url ) : boolean
$url array The array for the URL being generated.
return boolean
    protected function _matchMethod($url)
    {
        if (empty($this->defaults['_method'])) {
            return true;
        }
        if (isset($url['[method]'])) {
            $url['_method'] = $url['[method]'];
        }
        if (empty($url['_method'])) {
            return false;
        }
        if (!in_array(strtoupper($url['_method']), (array) $this->defaults['_method'])) {
            return false;
        }
        return true;
    }