Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adcpd/faker-bundle-symfony2

Faker is a PHP library that generates fake data for you
https://github.com/adcpd/faker-bundle-symfony2

Last synced: about 7 hours ago
JSON representation

Faker is a PHP library that generates fake data for you

Awesome Lists containing this project

README

        

# Faker-Bundle-symfony2
Faker is a PHP library that generates fake data for you

# AppKarnel.php : Config[df1]

public function registerBundles()
{
$bundles = array(
...
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
...
$bundles[] = new Administration\FakerBundle\FakerBundle();
}
return $bundles;
}

# Routing config: [df1]

faker:
resource: "@FakerBundle/Resources/config/routing.yml"
prefix: /

# How to use : [df1]

Pour appeler le service de Faker library :

/** @var $faker */
$faker = $this->getContainer()->get('faker.generator');

/** Use Exemple */
$faker->unique()->randomNumber(3) ;
$faker->numberBetween($min = 0, $max = 5)
$faker->Longitude
$faker->streetAddress
...