(Yaf >=1.0.0)
Yaf_Config_Simple::get — Retrieve a configuration value
Retrieves a configuration value by name. If name is omitted or null, the configuration object itself is returned.
nameThe configuration key to retrieve.
The value associated with name. Array values are wrapped in a Yaf_Config_Simple object. Returns null if the key does not exist, or the configuration object itself when name is null.
Приклад #1 Yaf_Config_Simple::get() example
<?php
$config = new Yaf_Config_Simple([
'application' => ['name' => 'MyApp'],
'database' => ['host' => 'localhost'],
]);
// Array values are wrapped in a Yaf_Config_Simple object
echo $config->get('database')->host, "\n";
echo $config->get('application')->name, "\n";
var_dump($config->get('missing'));
?>Поданий вище приклад виведе щось схоже на:
localhost MyApp NULL