Symfony 4 项目上的 Twig Error Unknown "format_number" 过滤器

Twig Error Unknown "format_number" filter on Symfony 4 project

format_number 是在 2.12 中引入的,据我所知我有 2.13,使用 {{ constant('Twig_Environment::VERSION') }} 输出 The current version is 2.13.0

这是我的作曲家 json,我只是不明白为什么我应该在这个 symfony 4.4.* 项目中得到一个未知的过滤器。

"require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "ext-json": "*",
        "beberlei/doctrineextensions": "^1.2",
        "friendsofsymfony/jsrouting-bundle": "^2.3",
        "sensio/framework-extra-bundle": "^5.4",
        "symfony/asset": "4.4.*",
        "symfony/console": "4.4.*",
        "symfony/dotenv": "4.4.*",
        "symfony/flex": "^1.3.1",
        "symfony/form": "4.4.*",
        "symfony/framework-bundle": "4.4.*",
        "symfony/orm-pack": "^1.0",
        "symfony/security-bundle": "4.4.*",
        "symfony/swiftmailer-bundle": "^3.2",
        "symfony/twig-bridge": "4.*",
        "symfony/twig-bundle": "4.4.*",
        "symfony/validator": "4.4.*",
        "symfony/web-server-bundle": "4.4.*",
        "symfony/yaml": "4.4.*",
        "twig/twig": "2.*"
    },

format_number 过滤器不是主 twig/twig 包的一部分。你需要 Twig Extra package/bundle,你可以安装它:

composer require twig/extra-bundle