/GreenText

Twig Extension to create greentext

Primary LanguagePHPMIT LicenseMIT

Greentext Extension

This is a Twig extension for Symfony Framework to make greentext green.

Installation for Symfony

composer require linnit/greentext

or update your composer.json

"require": {
    "linnit/greentext": "1.*"
}

Register an Extension as a Service

Add the extension to Symfony

# app/config/services.yml
    linnit.twig.greentext:
        class: Linnit\Twig\Extension\GreenTextExtension
        tags: ['twig.extension']

Usage

Standard greentext

{{ message|greentext }}

Specify your own colour

{{ message|greentext("#772953") }}

Testing

To test, just run phpunit

./vendor/phpunit/phpunit/phpunit