【问题标题】:How can I find app/AppKernel.php in Symfony 4?如何在 Symfony 4 中找到 app/AppKernel.php?
【发布时间】:2018-07-12 16:22:13
【问题描述】:

我想根据本教程在 Symfony 4 的 AppKernel 类中注册一个包:

https://symfony.com/doc/3.3/bundles.html

但我没有找到文件夹“app”,也没有找到文件 AppKernel.php,所以没有 AppKernel 类。是我安装 Symfony 时出错了,还是我需要自己创建一个 app 文件夹?

【问题讨论】:

    标签: php symfony symfony4 bundles symfony-http-kernel


    【解决方案1】:

    Symfony 4 的结构与 Symfony 3 不同

    如果您想在您的应用程序中启用捆绑,您必须更改 config/bundles.php 文件

    类似的东西

        // config/bundles.php
        return [
            // 'all' means that the bundle is enabled for any Symfony environment
            Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
            Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
            Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
    .
    .
    .
    
        ];
    

    有关更多信息,请参阅tutorial

    【讨论】:

      猜你喜欢
      • 2019-02-25
      • 1970-01-01
      • 1970-01-01
      • 2013-07-09
      • 2018-08-09
      • 2020-11-30
      • 1970-01-01
      • 2016-11-09
      • 1970-01-01
      相关资源
      最近更新 更多