(Yaf >=1.0.0)
Yaf_Config_Ini::offsetSet — Set a configuration value (ArrayAccess)
Attempts to set a configuration value using array syntax. This method is an alias of Yaf_Config_Ini::set(). Since Yaf_Config_Ini is always read-only, it always fails and emits a warning.
nameThe configuration key to set.
valueThe value to assign.
No value is returned. A warning is emitted, because Yaf_Config_Ini is read-only.
Örnek 1 Yaf_Config_Ini::offsetSet() example
<?php
/**
* Assume /etc/myapp/application.ini contains:
* [common]
* application.name = "MyApp"
* database.host = "localhost"
* database.port = 3306
*/
$config = new Yaf_Config_Ini('/etc/myapp/application.ini', 'common');
// Yaf_Config_Ini is read-only: a warning is emitted and the value is kept
$config['database.host'] = '192.0.2.10';
echo $config['database.host'], "\n";
?>Yukarıdaki örnek şuna benzer bir çıktı üretir:
localhost