A Ko3 Module by John Hobbs of Little Filament, Inc.
This module provides a lazy-loading, modular, locale aware fake data generator for Kohana 3.1.x.
It is inspired by (and borrows data from) Ruby's Faker gem, and Perl's Data::Faker
K3-Faker is a simple, standard module.
- Drop the source in your MODPATH folder.
- Add the module to Kohana::modules in your bootstrap.php
Use the module methods from Faker:
echo 'Name: ' . Faker::Name()->name();
Output:
Name: Abbigail Vandervort
Additionally, if you have no arguments, you can now act as if the module method is a property.
echo 'Name: ' . Faker::Name()->name;
An alternate syntax is to use the factory style (thanks @gevans):
echo 'Name: ' . Faker::factory( 'name' )->name;
Full documentation is available online