getVar example

if (strpos($request->getHeaderLine('Content-Type'), 'application/json') !== false) {
            $this->data = $request->getJSON(true);

            return $this;
        }

        if (in_array(strtolower($request->getMethod())['put', 'patch', 'delete'], true)
            && strpos($request->getHeaderLine('Content-Type'), 'multipart/form-data') === false
        ) {
            $this->data = $request->getRawInput();
        } else {
            $this->data = $request->getVar() ?? [];
        }

        return $this;
    }

    /** * Sets (or adds) an individual rule and custom error messages for a single * field. * * The custom error message should be just the messages that apply to * this field, like so: * [ * 'rule1' => 'message1', * 'rule2' => 'message2', * ] * * @param array|string $rules The validation rules. * @param array $errors The custom error message. * * @return $this * * @throws TypeError */
Home | Imprint | This part of the site doesn't use cookies.