diff --git a/README.md b/README.md index 36ab722..c6a4d63 100644 --- a/README.md +++ b/README.md @@ -337,6 +337,52 @@ $config->has('port'); // Returns false --- +### append +> Append a value onto an existing array configuration option. + +```php +Config::append( string $key, mixed $value ) : bool +``` + +| Parameter | Description | +| --------- | -------------------------------- | +| `$key` | Unique configuration option key | +| `$value` | Config item value | + +#### Example + +Append `baz` to the `tags` config item array. + +```php +$config->set('tags', ['foo', 'bar']) +$config->append('tags', 'baz'); // ['foo', 'bar', 'baz'] +``` + +--- + +### prepend +> Prepend a value onto an existing array configuration option. + +```php +Config::append( string $key, mixed $value ) : bool +``` + +| Parameter | Description | +| --------- | -------------------------------- | +| `$key` | Unique configuration option key | +| `$value` | Config item value | + +#### Example + +Prepend `baz` to the `tags` config item array. + +```php +$config->set('tags', ['foo', 'bar']) +$config->append('tags', 'baz'); // ['baz', 'foo', 'bar'] +``` + +--- + ### load > Load configuration options from a file or directory. @@ -387,7 +433,6 @@ Config::merge( Config $config [, bool $override = true ] ) : self #### Examples - Merge $anotherConfig into $config and override values in `$config` with values from `$anotherConfig`.