nucleos / twig-extensions
为twig提供有用的扩展。
3.3.0
2024-08-14 16:28 UTC
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/phpunit-phpunit-11.x
- dev-renovate/matthiasnoback-symfony-dependency-injection-test-6.x
- dev-readme-badge
- dev-dependabot/composer/vendor-bin/tools/phpunit/phpunit-9.5.12
This package is auto-updated.
Last update: 2024-09-14 18:58:48 UTC
README
为twig提供有用的扩展。
安装
打开命令行控制台,进入您的项目目录,然后执行以下命令以下载此库的最新稳定版本:
composer require nucleos/twig-extensions
Symfony 使用
如果您想在symfony中使用此库,可以使用桥梁。
启用 Bundle
然后,通过将其添加到项目中 config/bundles.php
文件中注册的包列表中来启用 Bundle
// config/bundles.php return [ // ... Nucleos\Twig\Bridge\Symfony\Bundle\NucleosTwigBundle::class => ['all' => true], ];
Twig 文本垃圾邮件保护
Twig 过滤器 spamsecure
替换所有点和 @ 符号。
{# Replace plain text #} {{ text|spamsecure }} {# Replace rich text mails #} {{ htmlText|spamsecure(true) }}
配置 Bundle
创建一个名为 nucleos_twig.yaml
的配置文件
# config/packages/nucleos_twig.yaml nucleos_twig: secure: mail: at_text: [ ' [AT] ', ' (AT) ', ' [ÄT] ' ] dot_text: [ ' [DOT] ', ' (DOT) ', ' [.] ' ]
许可证
此库受 MIT 许可证 的约束。