Faker Service Provider for Silex
PHP Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Tests Applied fixes from StyleCI Sep 13, 2015
.gitignore code utilities Feb 8, 2015
.travis.yml added php7 Oct 11, 2015
FakerServiceProvider.php Applied fixes from StyleCI Sep 13, 2015
LICENSE Create LICENSE Jan 29, 2015
README.md code utilities Feb 8, 2015
phpunit.xml.dist code utilities Feb 8, 2015


Faker Service Provider

Build Status SensioLabs Insight Coverage Status Scrutinizer Code Quality Total Downloads

A Faker service provider for Silex.

API: emanueleminotto.github.io/FakerServiceProvider


Install Silex using Composer.

Install the FakerServiceProvider adding emanueleminotto/faker-service-provider to your composer.json or from CLI:

$ composer require emanueleminotto/faker-service-provider


Initialize it using register

use EmanueleMinotto\FakerServiceProvider\FakerServiceProvider;

$app->register(new FakerServiceProvider(), array(
    'faker.providers' => array(
    ), // default empty
    'locale' => 'it_IT', // default: en_US

From PHP

$app->get('/hello', function () use ($app) {
    return 'Hello ' . $app['faker']->name;

From Twig

<!DOCTYPE html>
        <p>Hello {{ app.faker.name }}!</p>