【问题标题】:I don't find the folder and file app/appkernel.php in symfony 4 ton enable Easy Admin Bundle我在 symfony 4 ton enable Easy Admin Bundle 中找不到文件夹和文件 app/appkernel.php
【发布时间】:2019-02-25 14:37:04
【问题描述】:

要安装 EasyAdmin Bundle,我需要在 app/AppKernel.php 中启用该包,但我没有找到它!请帮忙!

谢谢!!!

【问题讨论】:

    标签: symfony easyadmin


    【解决方案1】:

    Symfony 4 引入了一个名为 flex 的新作曲家插件:
    https://symfony.com/doc/current/setup/flex.html

    使用composer req admin 安装 EasyAdminBundle 将自动配置默认值和 还将捆绑包添加到 bundles.php 文件。

    之后不再需要手动步骤,只需将新文件添加到 git。

    【讨论】:

      【解决方案2】:

      在 Symfony4 中默认没有 app/ 文件夹,结构与之前的 Symfony 版本不同。

      您必须将您的捆绑包添加到config/bundles.php。内核类应该在src/Kernel.php

      了解更多:http://fabien.potencier.org/symfony4-directory-structure.html

      【讨论】:

      • 但是我迷路了!在我的文件 bundle.php 中,启用了 easyadmin。在 Symfony 的文档中,我们在数组 ($bundles) 中有一个新类 EasyAdminBundle,我必须在哪里添加它?
      • src/Kernel.php 类负责从该数组加载包。看Kernel方法registerBundles()
      猜你喜欢
      • 2019-05-19
      • 1970-01-01
      • 1970-01-01
      • 2011-04-12
      • 1970-01-01
      • 2018-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多