2017 © Pedro Peláez
 

library nette-fakerino

Nette extension for Fakerino

image

fakerino/nette-fakerino

Nette extension for Fakerino

  • Sunday, June 21, 2015
  • by niklongstone
  • Repository
  • 1 Watchers
  • 2 Stars
  • 31 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Fakerino Nette

Latest Stable Version License, (*1)

Provides an easy way to include Fakerino in Nette framework as a service., (*2)

More information in the official documentation., (*3)

Installation

Add the following dependencies to your projects composer.json file:, (*4)

    "require": {
        "fakerino/nette-fakerino": "0.0.*",
    }

Install the Open Data Sample in two ways:

  • Add a script to your composer.json:
  "scripts": {
        "post-install-cmd": "vendor/fakerino/fakerino/build/ods vendor/fakerino/fakerino/data",
        "post-update-cmd": "vendor/fakerino/fakerino/build/ods vendor/fakerino/fakerino/data"
    }

In this way the data will be always updated automatically via composer., (*5)

  • Run maually the command (after the fakerino composer installation): $ vendor/fakerino/fakerino/build/ods vendor/fakerino/fakerino/data

Configuration

Add in your config.neon the service definition as below:, (*6)

services:
    fakerino:
        class: Fakerino\Core\FakeDataFactory
        factory: Fakerino\FakerinoNette\FakerinoServiceFactory::create

In order to customise the Fakerino default configuration you could add fakerino in your config.neon parameters., (*7)

parameters:
    fakerino:
        locale: cs-CZ
        fake:
            fakeMale:
              - titlemale
              - nameMale
              - surname
            fakeFemale:
              - titlefemale
              - namefemale
              - surname
        database:
            dbname: mydb
            user: username
            password: password
            host: localhost
            driver: pdo_mysql

Presenter example

<?php

namespace App\Presenters;

use Nette,
    App\Model;
use Fakerino\Core\FakeDataFactory;

/**
 * Homepage presenter.
 */
class HomepagePresenter extends Nette\Application\UI\Presenter
{
    /**
     * @var \Fakerino\Core\FakeDataFactory
     */
    private $fakerino;

    public function __construct(FakeDataFactory $fakerino)
    {
        $this->fakerino = $fakerino;
    }

    public function renderDefault()
    {
        $this->template->surname = $this->fakerino->fake('surname');
    }
}

The Versions

21/06 2015

dev-master

9999999-dev

Nette extension for Fakerino

  Sources   Download

MIT

The Requires

 

extension php generator data nette fake fakerino

19/06 2015

0.0.2

0.0.2.0

Nette extension for Fakerino

  Sources   Download

MIT

The Requires

 

extension php generator data nette fake fakerino

02/06 2015

0.0.1

0.0.1.0

Nette extension for Fakerino

  Sources   Download

MIT

The Requires

 

extension php generator data nette fake fakerino