PHP code example of kerox / twig-image-placeholder-extension
1. Go to this page and download the library: Download kerox/twig-image-placeholder-extension 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/ */
kerox / twig-image-placeholder-extension example snippets
$extension = new \Kerox\TwigImagePlaceholder\SvgPlaceholderExtension();
$twig = new \Twig\Environment($loader);
$twig->addExtension($extension);
twig
{{ svg_placeholder(300, 150, {
text: 'Foo Bar'
}) }}
twig
{{ svg_placeholder(300, 150, {
text: false
}) }}