App::hasConfig
Usage
bool App::hasConfig(string $key)Description
Checks whether or not the key exists within the configuration variables.Parameters
Parameter | Required | Type | Description |
---|---|---|---|
$key | Yes | string | The name of the variable to check whether or not it exists in the configuration variables. |
Return Value
Boolean whether or not the variable exists within the configuration variables.Examples
Check whether or not variable exists in configuration.
if (!$app->hasConfig('my_package.some_var')) {
throw new Exception("Missing configuration variable");
}