如何在Symfony 4中找到app/AppKernel.php?

pea*_*ove 2 php kernel bundles symfony

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

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

但我找不到文件夹"app",也没有找到AppKernel.php文件,所以不是AppKernel类.我是否通过Symfony安装犯了错误,还是我需要自己创建一个app文件夹?

ped*_*ani 7

Symfony 4的结构与Symfony 3不同

如果要在应用程序中启用bundle,则必须更改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],
.
.
.

    ];
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请参阅本教程