Yaf_Config_Simple::__isset
PHP function
Edit on GitHub ✎
(Yaf >=1.0.0)
Check if a key exists
Description
Yaf_Config_Simple::__isset(string $name): bool
Checks whether a configuration key exists. This method is invoked when isset() is used on a configuration object.
Parameters
nameThe configuration key to check.
Return Values
Returns true if the key exists, false otherwise.
Examples
Yaf_Config_Simple::__isset example
php
<?php
$config = new Yaf_Config_Simple([
'application' => ['name' => 'MyApp'],
'database' => ['host' => 'localhost'],
]);
var_dump(isset($config->application));
var_dump($config->__isset('application'));
var_dump(isset($config->cache));
?>The above example will output something similar to:
output
bool(true)
bool(true)
bool(false)See Also
Yaf_Config_Simple::getYaf_Config_Simple::offsetExists