tentwofour/symfony-twig-bridge

Symfony 实现的 tentwofour/twig 包

1.1.2 2022-01-24 16:04 UTC

This package is auto-updated.

Last update: 2024-09-24 21:41:29 UTC


README

提供将 Twig 扩展 (https://github.com/tentwofour/twig) 集成到 Symfony2 的桥梁。

在 AppKernel 中启用

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Ten24\SymfonyTwigBridgeBundle\Ten24SymfonyTwigBridgeBundle()
        )
        ...
    }
    ...
}

用法

默认情况下,该包默认注册来自 https://github.com/tentwofour/twig 的所有扩展。请参阅该包的扩展文档。

可以通过包配置禁用任何/所有扩展

# app/config.yml

ten24_twig:
    email: false
    diff: false
    inflector: false
    money: false
    number: false