1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-19 06:49:50 +01:00

Move image provider up

This commit is contained in:
Francois Zaninotto 2013-10-21 22:40:49 +02:00
parent 5c8ffa5561
commit a78eb24fdf

View File

@ -195,6 +195,22 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
safeColorName // 'fuchsia'
colorName // 'Gainsbor'
### `Faker\Provider\Image`
/**
* Image generation provided by LoremPixel (http://lorempixel.com/)
*
* @param $dir An absolute path to a local directory
* @param $width/$height Size (in pixel) of the generated image (defaults to 640x480)
* @param $category One of 'abstract','animals','business','cats','city','food','nightlife','fashion','people','nature','sports','technics', and 'transport'
*/
image($dir) // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
image($dir, $width, $height) // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
image($dir, $width, $height, $category) // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
imageUrl // 'http://lorempixel.com/640/480/'
imageUrl($width, $height) // 'http://lorempixel.com/800/600/'
imageUrl($width, $height, $category) // 'http://lorempixel.com/800/600/person/'
### `Faker\Provider\Payment`
creditCardType // 'MasterCard'
@ -243,24 +259,6 @@ $faker->optional($weight = 0.9)->randomDigit; // 90% chance to get null
// the default $weight value is 0.5
```
### `Faker\Provider\Image`
/**
* Image generation provided by LoremPixel (http://lorempixel.com/)
*
* @param $dir An absolute path to a local directory
* @param $width/$height Size (in pixel) of the generated image (defaults to 640x480)
* @param $category One of 'abstract','animals','business','cats','city','food','nightlife','fashion','people','nature','sports','technics', and 'transport'
*/
image($dir) // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
image($dir, $width, $height) // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
image($dir, $width, $height, $category) // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
imageUrl // 'http://lorempixel.com/1160/1160/'
imageUrl($width, $height) // 'http://lorempixel.com/800/600/'
imageUrl($width, $height, $category) // 'http://lorempixel.com/800/600/person/'
personImage($dir) // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
personImageUrl // 'http://lorempixel.com/1160/1160/person/'
## Localization
`Faker\Factory` can take a locale as an argument, to return localized data. If no localized provider is found, the factory fallbacks to the default locale (en_EN).