(Yaf >=1.0.0)
Yaf_Config_Simple::offsetSet — Set a configuration value (ArrayAccess)
Sets a configuration value using array syntax. This method is an alias of Yaf_Config_Simple::set(). The assignment fails silently if the configuration is read-only.
nameThe configuration key to set.
valueThe value to assign.
No value is returned. The assignment fails if the configuration is read-only.
Example #1 Yaf_Config_Simple::offsetSet() example
<?php
$config = new Yaf_Config_Simple(['env' => 'development']);
// Writable by default
$config['env'] = 'production';
$config['cache'] = ['enable' => true];
echo $config['env'], "\n";
var_dump($config['cache']['enable']);
// Assignments to a read-only configuration fail silently
$frozen = new Yaf_Config_Simple(['env' => 'development'], true);
$frozen['env'] = 'production';
echo $frozen['env'], "\n";
?>The above example will output something similar to:
production bool(true) development