PHP code example of olivier127 / sulu-picture-placeholder-generator-bundle

1. Go to this page and download the library: Download olivier127/sulu-picture-placeholder-generator-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/ */

    

olivier127 / sulu-picture-placeholder-generator-bundle example snippets

twig
{% set placeholder = sulu_generate_placeholder('thumbnail') %}
<img src="{{ placeholder }}" alt="Placeholder Image">

{% set placeholder = sulu_generate_placeholder('thumbnail', { 'text': 'Sulu CMS', 'text_font': 'lato' }) %}
<img src="{{ placeholder }}" alt="Placeholder Image">

{% set placeholder = sulu_generate_placeholder('thumbnail', { 'background_color': 'ccc', 'text_color': '000' }) %}
<img src="{{ placeholder }}" alt="Placeholder Image">
twig
{% set picture = sulu_generate_picture('thumbnail') %}
<img src="{{ picture }}" alt="Generated Picture">

{% set picture = sulu_generate_picture('thumbnail', { 'seed': '123456' }) %}
<img src="{{ picture }}" alt="Generated Picture">

{% set picture = sulu_generate_picture('thumbnail', { 'id': 100 }) %}
<img src="{{ picture }}" alt="Generated Picture">