nucleos / twig-extensions
Useful extensions for twig.
Fund package maintenance!
core23
Opencollective
Ko-Fi
Other
Installs: 43 655
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 5
Requires
- php: ^8.1
- ext-pcre: *
- symfony/routing: ^6.4 || ^7.0
- symfony/translation-contracts: ^2.0 || ^3.0
- twig/twig: ^3.3
Requires (Dev)
- ergebnis/composer-normalize: ^2.5.1
- symfony/browser-kit: ^6.4 || ^7.0
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/expression-language: ^6.4 || ^7.0
- symfony/framework-bundle: ^6.3 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/intl: ^6.4 || ^7.0
- symfony/polyfill-intl-icu: ^1.13
- symfony/twig-bridge: ^6.4 || ^7.0
- symfony/twig-bundle: ^6.4 || ^7.0
Suggests
- symfony/framework-bundle: If you want to use symfony
Conflicts
- symfony/framework-bundle: <6.4
- 3.4.x-dev
- 3.3.x-dev
- 3.3.0
- 3.2.x-dev
- 3.2.0
- 3.1.x-dev
- 3.1.0
- 3.0.x-dev
- 3.0.0
- 2.6.x-dev
- 2.5.x-dev
- 2.5.0
- 2.4.x-dev
- 2.4.0
- 2.3.x-dev
- 2.3.0
- 2.2.x-dev
- 2.2.0
- 2.1.0
- 2.0.0
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.1
- 1.0.0
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.0
- dev-renovate/major-phpstan-packages
- dev-renovate/matthiasnoback-symfony-dependency-injection-test-6.x
- dev-renovate/phpunit-phpunit-11.x
- dev-readme-badge
- dev-dependabot/composer/vendor-bin/tools/phpunit/phpunit-9.5.12
This package is auto-updated.
Last update: 2024-11-11 10:36:55 UTC
README
Useful extensions for twig.
Installation
Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:
composer require nucleos/twig-extensions
Symfony usage
If you want to use this library inside symfony, you can use a bridge.
Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in config/bundles.php
file of your project:
// 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.
{# Replace plain text #} {{ text|spamsecure }} {# Replace rich text mails #} {{ htmlText|spamsecure(true) }}
Configure the Bundle
Create a configuration file called nucleos_twig.yaml
:
# 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.