<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vstelmakh / url-highlight-twig-extension example snippets
use Twig\Environment;
use Twig\Loader\FilesystemLoader;
use VStelmakh\UrlHighlight\UrlHighlight;
use VStelmakh\UrlHighlightTwigExtension\UrlHighlightExtension;
// create twig environment
$loader = new FilesystemLoader('/path/to/templates');
$twig = new Environment($loader, []);
// add extension
$urlHighlight = new UrlHighlight();
$twig->addExtension(new UrlHighlightExtension($urlHighlight));
use Twig\Environment;
use Twig\Loader\FilesystemLoader;
use VStelmakh\UrlHighlight\Encoder\HtmlSpecialcharsEncoder;
use VStelmakh\UrlHighlight\UrlHighlight;
use VStelmakh\UrlHighlightTwigExtension\UrlHighlightExtension;
$loader = new FilesystemLoader('/path/to/templates');
$twig = new Environment($loader, []);
$encoder = new HtmlSpecialcharsEncoder();
$urlHighlight = new UrlHighlight(null, null, $encoder);
$twig->addExtension(new UrlHighlightExtension($urlHighlight));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.