Collective\Html\FormBuilder::getAppendage PHP Method

getAppendage() protected method

Get the form appendage for the given method.
protected getAppendage ( string $method ) : string
$method string
return string
    protected function getAppendage($method)
    {
        list($method, $appendage) = [strtoupper($method), ''];
        // If the HTTP method is in this list of spoofed methods, we will attach the
        // method spoofer hidden input to the form. This allows us to use regular
        // form to initiate PUT and DELETE requests in addition to the typical.
        if (in_array($method, $this->spoofedMethods)) {
            $appendage .= $this->hidden('_method', $method);
        }
        // If the method is something other than GET we will go ahead and attach the
        // CSRF token to the form, as this can't hurt and is convenient to simply
        // always have available on every form the developers creates for them.
        if ($method != 'GET') {
            $appendage .= $this->token();
        }
        return $appendage;
    }