Symfony/flex 安装 stof_doctrine_extensions 时出现问题

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

我正在尝试在我的 symfony 项目中使用 slugs。我想做的第一件事是安装 StofDoctrineExtensionsBundle。我尝试按照 symfony 网站上的教程进行操作

https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html

命令的结果:composer require stof/doctrine-extensions-bundle 是

Using version ^1.6 for stof/doctrine-extensions-bundle
./composer.json has been updated
Running composer update stof/doctrine-extensions-bundle
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating optimized autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
52 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Run composer recipes at any time to see the status of your Symfony recipes.

Executing script cache:clear [OK]
Executing script assets:install public [OK]

Nothing to unpack

这对我来说似乎没问题,但应该生成一个名为“stof_doctrine_extensions.yaml”的文件,但没有自动创建。现在我尝试手动创建文件,老实说我不知道这是否是一个好的举措,这是我的文件的样子

stof_doctrine_extensions:
  default_locale: en_US
  orm:
      default:
          sluggable: true

我仍然没有弄清楚现在的错误是:

/stof_doctrine_extensions.yaml"). Looked for namespace "stof_doctrine_extensions", found ""framework", "maker", "twig", "doctrine", "doctrine_migrations", "web_server"" in /config/packages/stof_doctrine_extensions.yaml (which is being imported from "/src/Kernel.php").

如果有人可以帮助我,我将非常感激

php symfony doctrine-extensions
1个回答
0
投票

我遇到了完全相同的问题,我使用composer这样卸载stof:“composer删除stof/doctrine-extensions-bundle”和“symfony控制台缓存:clear”,之后我重新安装了它:“composer require stof/doctrine-扩展包”。它应该要求您确认配方的执行,请确保您点击“y”表示“是”,因为默认值为 n。问题是我第一次安装它时,我按了配方的“否”,但它没有生成文件。

© www.soinside.com 2019 - 2024. All rights reserved.