Skip to content

Commit

Permalink
Added Config::append() and Config::prepend() documentation to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
PHLAK committed Dec 23, 2019
1 parent 6d583a6 commit 89c4ca9
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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`.

Expand Down

0 comments on commit 89c4ca9

Please sign in to comment.