You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Julio Montoya
2cb00363ff
|
12 years ago | |
---|---|---|
.. | ||
src/EmanueleMinotto | 12 years ago | |
README.md | 12 years ago | |
composer.json | 12 years ago |
README.md
FakerServiceProvider
A Faker service provider for Silex.
Install
Install Silex using Composer.
Install the FakerServiceProvider adding emanueleminotto/faker-service-provider
to your composer.json or from CLI:
$ php composer.phar require emanueleminotto/faker-service-provider
Usage
Initialize it using register
, it allows only the locale
option
<?php
use EmanueleMinotto\FakerServiceProvider;
$app->register(new FakerServiceProvider, array(
'locale' => 'it_IT' // default: en_US
));
From PHP
<?php
$Application -> get('/hello', function () use ($Application) {
return 'Hello ' . $Application['faker'] -> name;
});
From Twig
<!DOCTYPE html>
<html>
<body>
<p>Hello {{ app.faker.name }}!</p>
</body>
</html>