vstelmakh/twig-url-highlight-bundle

Symfony bundle for twig url highlight extension


Keywords
symfony, url, bundle, html, highlight
License
MIT

Documentation

Twig url highlight bundle

Symfony bundle for twig url highlight extension

Installation

Install the latest version with:

$ composer require vstelmakh/twig-url-highlight-bundle

Setup

If your application is using Symfony Flex - you are ready to go, skip next steps.

Enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    VStelmakh\TwigUrlHighlightBundle\TwigUrlHighlightBundle::class => ['all' => true],
];

Usage

Use urls_to_html filter in your templates:

{{ 'Basic example http://example.com'|urls_to_html }}

{# output: Basic example <a href="http://example.com">http://example.com</a> #}

More details see usage in Twig url highlight repository.

Credits

Volodymyr Stelmakh
Licensed under the MIT License. See LICENSE for more information.