PHP code example of knpuniversity / lorem-ipsum-bundle

1. Go to this page and download the library: Download knpuniversity/lorem-ipsum-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

knpuniversity / lorem-ipsum-bundle example snippets


// src/Controller/SomeController.php

use KnpU\LoremIpsumBundle\KnpUIpsum;
// ...

class SomeController
{
    public function index(KnpUIpsum $knpUIpsum)
    {
        $fakeText = $knpUIpsum->getParagraphs();

        // ...
    }
}

namespace App\Service;

use KnpU\LoremIpsumBundle\WordProviderInterface;

class CustomWordProvider implements WordProviderInterface
{
    public function getWordList(): array
    {
        return ['beach'];
    }
}