public function getBooleanParam($name, $default = null, $optional = false)
    {
        $value = $this->getParam($name, $default, $optional);
        if ($value !== null) {
            if (!is_bool($value) && !preg_match('/^(0|1|true|false)$/', $value)) {
                throw new InvalidParameterException("Parameter '{$name}' is invalid");
            }
            $value = $value === true || $value === '1' || $value === 'true';
        }
        return $value;
    }
public function getBooleanParam($name, $default = null, $optional = false)
    {
        $value = $this->getParam($name, $default, $optional);
        if ($value !== null) {
            if (!is_bool($value) && !preg_match('/^(0|1|true|false)$/', $value)) {
                throw new InvalidParameterException("Parameter '{$name}' is invalid");
            }
            $value = $value === true || $value === '1' || $value === 'true';
        }
        return $value;
    }
public function getBooleanParam ( $ name , $ default = null , $ optional = false ) { $ value = $ this -> getParam ( $ name , $ default , $ optional ) ; if ( $ value !== null ) { if ( ! is_bool ( $ value ) && ! preg_match ( '/^(0|1|true|false)$/' , $ value ) ) { throw new InvalidParameterException ( "Parameter '{$name}' is invalid" ) ; } $ value = $ value === true || $ value === '1' || $ value === 'true' ; } return $ value ; }
Returns the value of the specified parameter as a boolean value.

@param  string $name
@param  bool   $default
@param  bool   $optional
@return bool
@throws InvalidParameterException
Returns the value of the specified parameter as a boolean value .