Skip to content

Commit

Permalink
Add Symfony service registration example
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Sep 18, 2018
1 parent e8b80c9 commit c37dcd0
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion doc/customizing-data-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,28 @@ the `NativeLoader::createFakerGenerator()` method.

If you are using Symfony, custom Faker providers are registered by adding the
tag `nelmio_alice.faker.provider` to the services. Note that this is automatically
done if your service extends `Faker\Provider\Base`.
done if your service extends `Faker\Provider\Base` and have `autoconfigure` enabled:

```yaml
# config/services.yaml
services:
_defaults:
autoconfigure: true
App\Faker\Provider\JobProvider: ~
```

or:


```yaml
# config/services.yaml
services:
App\Faker\Provider\JobProvider:
tags: [ { name: nelmio_alice.faker.provider } ]
```


<br />
Expand Down

0 comments on commit c37dcd0

Please sign in to comment.