public function getMethod()
    {
        if ($this->method) {
            return $this->method;
        }

        $method = @$_SERVER['REQUEST_METHOD'];
        if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']))
            $method = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'];

        if (isset($_GET['_method']))
            $method = $_GET['_method'];
        else if (isset($_POST['_method']))
            $method = $_POST['_method'];

        $method = strtolower($method);

        if (!in_array($method, $this->methods))
            $method = 'get';

        return $method;

    }
public function getMethod()
    {
        if ($this->method) {
            return $this->method;
        }

        $method = @$_SERVER['REQUEST_METHOD'];
        if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']))
            $method = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'];

        if (isset($_GET['_method']))
            $method = $_GET['_method'];
        else if (isset($_POST['_method']))
            $method = $_POST['_method'];

        $method = strtolower($method);

        if (!in_array($method, $this->methods))
            $method = 'get';

        return $method;

    }
public function getMethod ( ) { if ( $ this -> method ) { return $ this -> method ; } $ method = @ $ _SERVER [ 'REQUEST_METHOD' ] ; if ( isset ( $ _SERVER [ 'HTTP_X_HTTP_METHOD_OVERRIDE' ] ) ) $ method = $ _SERVER [ 'HTTP_X_HTTP_METHOD_OVERRIDE' ] ; if ( isset ( $ _GET [ '_method' ] ) ) $ method = $ _GET [ '_method' ] ; else if ( isset ( $ _POST [ '_method' ] ) ) $ method = $ _POST [ '_method' ] ; $ method = strtolower ( $ method ) ; if ( ! in_array ( $ method , $ this -> methods ) ) $ method = 'get' ; return $ method ; }
Detect the method.

@return string
Detect the method .