2017 © Pedro Peláez
 

patternlab-plugin plugin-faker

Faker Support for Pattern Lab

image

pattern-lab/plugin-faker

Faker Support for Pattern Lab

  • Sunday, July 3, 2016
  • by EvanLovely
  • Repository
  • 3 Watchers
  • 4 Stars
  • 56,719 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 8 Forks
  • 6 Open issues
  • 6 Versions
  • 19 % Grown

The README.md

license Packagist Gitter, (*1)

Faker Plugin for Pattern Lab

The Faker Plugin adds Faker support to Pattern Lab. The Faker Plugin will create unique content each time Pattern Lab is generated. You can also use the Faker Plugin to provide locale appropriate content., (*2)

Installation

To add the Faker Plugin to your project using Composer type:, (*3)

composer require pattern-lab/plugin-faker

See Packagist for information on the latest release., (*4)

Usage

You can create fake data in your json or yml data files by using this format:, (*5)

"key": "Faker.[formatter]([options])"

If a formatter has no options or you want to use the formatter's default options you can use the following format:, (*6)

"key": "Faker.[formatter]"

See below for a list of formatters and their options., (*7)

Example

To create a random first name without regard to gender you can add the following to your json or yml data files:, (*8)

"firstName": "Faker.firstName"

To specify a gender you would use:, (*9)

"firstName": "Faker.firstName('female')"

Formatters

The Faker Plugin supports the following content formatters:, (*10)

  • Faker\Provider\en_US\Person
  • Faker\Provider\en_US\Address
  • Faker\Provider\en_US\PhoneNumber
  • Faker\Provider\en_US\Company
  • Faker\Provider\Lorem
  • Faker\Provider\Internet
  • Faker\Provider\Color
  • Faker\Provider\Payment
  • Faker\Provider\DateTime
  • Faker\Provider\Image
  • Faker\Provider\Miscellaneous

See the official repository for a list of options available to each formatter., (*11)

Locales

The content produced by Faker can be localized based on a Faker locale. If the Faker locale isn't supported by a formatter the content will fall back to the default en_US. There is a list of Faker locales., (*12)

To update your Faker locale you can either directly edit ./config/config.yml or use the command line option:, (*13)

php core/console --config --set plugins.faker.locale=[locale]

For example:, (*14)

php core/console --config --set plugins.faker.locale=fr_FR

Disabling the Plugin

To disable the Faker plugin you can either directly edit ./config/config.yml or use the command line option:, (*15)

php core/console --config --set plugins.faker.enabled=false

The Versions

03/07 2016

dev-master

9999999-dev http://patternlab.io

Faker Support for Pattern Lab

  Sources   Download

MIT

The Requires

 

faker pattern lab

03/07 2016

v2.0.0

2.0.0.0 http://patternlab.io

Faker Support for Pattern Lab

  Sources   Download

MIT

The Requires

 

faker pattern lab

30/06 2016

dev-dev

dev-dev http://patternlab.io

Faker Support for Pattern Lab

  Sources   Download

MIT

The Requires

 

faker pattern lab

21/06 2016

v1.0.2

1.0.2.0 http://patternlab.io

Faker Support for Pattern Lab

  Sources   Download

MIT

The Requires

 

faker pattern lab

21/06 2016

v1.0.1

1.0.1.0 http://patternlab.io

Faker Support for Pattern Lab

  Sources   Download

MIT

The Requires

 

faker pattern lab

18/06 2016

v1.0.0

1.0.0.0 http://patternlab.io

Faker Support for Pattern Lab

  Sources   Download

MIT

The Requires

 

faker pattern lab