Skip to content

Commit

Permalink
docs: detail how new configuration works
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
  • Loading branch information
weierophinney committed Jul 14, 2022
1 parent ed68ef0 commit a1479a9
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Expand Up @@ -40,6 +40,52 @@ Run the following to install this library:
$ composer require laminas/laminas-zendframework-bridge
```

## Configuration

- Since 1.6.0

You may provide additional replacements for the configuration post processor.
This is particularly useful if your application uses third-party components that include class names that the post processor otherwise rewrites, and which you want to never rewrite.

Configuration is via the following structure:

```php
return [
'laminas-zendframework-bridge' => [
'replacements' => [
'to-replace' => 'replacement',
// ...
],
],
];
```

As an example, if your configuration included the following dependency mapping:

```php
return [
'controller_plugins' => [
'factories' => [
'customZendFormBinder' => \CustomZendFormBinder\Controller\Plugin\Factory\BinderPluginFactory::class,
],
],
];
```

And you wanted the two strings that contain the verbiage `ZendForm` to remain untouched, you could define the following replacements mapping:

```php
return [
'laminas-zendframework-bridge' => [
'replacements' => [
// Never rewrite!
'customZendFormBinder' => 'customZendFormBinder',
'CustomZendFormBinder' => 'CustomZendFormBinder',
],
],
];
```

## Support

* [Issues](https://github.com/laminas/laminas-zendframework-bridge/issues/)
Expand Down

0 comments on commit a1479a9

Please sign in to comment.