2017 © Pedro Peláez
 

library twig-extensions

Useful extensions for twig.

image

core23/twig-extensions

Useful extensions for twig.

  • Sunday, July 15, 2018
  • by core23
  • Repository
  • 0 Watchers
  • 1 Stars
  • 224 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 4 Versions
  • 22 % Grown

The README.md

Twig Extensions

Latest Stable Version Latest Unstable Version License, (*1)

Total Downloads Monthly Downloads Daily Downloads, (*2)

Continuous Integration Code Coverage Type Coverage, (*3)

Useful extensions for twig., (*4)

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:, (*5)

composer require nucleos/twig-extensions

Symfony usage

If you want to use this library inside symfony, you can use a bridge., (*6)

Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in config/bundles.php file of your project:, (*7)

// config/bundles.php

return [
    // ...
    Nucleos\Twig\Bridge\Symfony\Bundle\NucleosTwigBundle::class => ['all' => true],
];

Twig text spam protection

The Twig filter spamsecure replaces all dot and @-signs., (*8)

{# Replace plain text #}
{{ text|spamsecure }}

{# Replace rich text mails #}
{{ htmlText|spamsecure(true) }}

Configure the Bundle

Create a configuration file called nucleos_twig.yaml:, (*9)

# config/packages/nucleos_twig.yaml

nucleos_twig:
    secure:
        mail:
            at_text:   [ ' [AT] ', ' (AT) ', ' [ÄT] ' ]
            dot_text:  [ ' [DOT] ', ' (DOT) ', ' [.] ' ]

License

This library is under the MIT license., (*10)

The Versions