yii\web\Request::getBodyParam PHP Method

getBodyParam() public method

If the parameter does not exist, the second parameter passed to this method will be returned.
See also: getBodyParams()
See also: setBodyParams()
public getBodyParam ( string $name, mixed $defaultValue = null ) : mixed
$name string the parameter name
$defaultValue mixed the default parameter value if the parameter does not exist.
return mixed the parameter value
    public function getBodyParam($name, $defaultValue = null)
    {
        $params = $this->getBodyParams();
        return isset($params[$name]) ? $params[$name] : $defaultValue;
    }