2017 © Pedro Peláez
 

library faker-service-provider

Faker Service Provider for Silex

image

kphoen/faker-service-provider

Faker Service Provider for Silex

  • Sunday, May 29, 2016
  • by K-Phoen
  • Repository
  • 1 Watchers
  • 0 Stars
  • 521 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

FakerServiceProvider Build Status

A Faker service provider for Silex., (*1)

N.B: this provider is locale aware. It will automatically configure Faker to use the most suited locale for the request., (*2)

Status

This project is DEPRECATED and should NOT be used., (*3)

If someone magically appears and wants to maintain this project, I'll gladly give access to this repository., (*4)

Usage

Initialize it using register. Its default behavior is to use Faker's factory and try to guess the right locale to use., (*5)

<?php

use KPhoen\Provider\FakerServiceProvider;

$app->register(new FakerServiceProvider());

In this example, we use a custom factory and force the locale (both in the provider and in the whole application) to fr_FR:, (*6)

<?php

use KPhoen\Provider\FakerServiceProvider;

$app->register(new FakerServiceProvider('\Acme\Faker\Factory', $guessLocale = false), array(
    'locale' => 'fr_FR',
));

From your controllers:, (*7)

<?php

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

From Twig:, (*8)

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

Installation

Install the FakerServiceProvider adding kphoen/faker-service-provider to your composer.json or from CLI:, (*9)

$ php composer.phar require 'kphoen/faker-service-provider:~1.0'

Licence

This provider is released under the MIT license., (*10)

The Versions

29/05 2016

dev-master

9999999-dev

Faker Service Provider for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

18/09 2013

1.0.2

1.0.2.0

Faker Service Provider for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

12/09 2013

1.0.1

1.0.1.0

Faker Service Provider for Silex

  Sources   Download

MIT

The Requires

 

04/09 2013

1.0.0

1.0.0.0

Faker Service Provider for Silex

  Sources   Download

MIT

The Requires