如何从 symfony 中删除 twig?

问题描述 投票:0回答:1

我的项目不需要任何树枝功能或模板。

我从

移除了树枝
  • composer.json
  • bundles.php
  • 我删除了所有配置树枝文件(yml 文件)
  • 我删除了 html 模板(index.html.twig)

当我现在运行作曲家时,它会说

    Script cache:clear returned with error code 1
!!
!!  In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
!!
!!    The service "web_profiler.controller.profiler" has a dependency on a non-ex
!!    istent service "twig". Did you mean one of these: "maker.maker.make_twig_ex
!!    tension", "maker.auto_command.make_twig_extension"?
!!
!!
!!
Script @auto-scripts was called via post-install-cmd

我还忘记删除什么?

php symfony composer-php twig
1个回答
6
投票

您正在使用网络分析器,当您使用时,您需要 Twig

在这种情况下,声明“我的项目不需要任何树枝功能或模板”是不正确的。您在生产中不需要此功能,但您在开发中使用它(如果是间接的)。

您的选择是:

    删除 Web Profiler Bundle(以及任何其他需要 Twig 的包,运行
  • composer why twig/twig
     可能是个好主意)。
  • 仅在开发版上安装 twig (
  • composer install twig/twig --dev
    )
© www.soinside.com 2019 - 2024. All rights reserved.