Faker Service Provider for Silex

1.1.0 2015-02-04 08:59 UTC

This package is auto-updated.

Last update: 2023-01-28 03:39:49 UTC


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>