【问题标题】:Symfony 3.4 and Fixtures Bundle issue with bundle version 3.0Symfony 3.4 和 Fixtures Bundle 与 bundle 版本 3.0 的问题
【发布时间】:2018-10-19 12:58:37
【问题描述】:

我正在尝试从 https://symfony.com/doc/master/bundles/DoctrineFixturesBundle/index.html 配置捆绑包

当我尝试运行命令时:

$ php bin/console doctrine:fixtures:load

出现错误: 在 LoadDataFixturesDoctrineCommand.php 第 95 行: 找不到任何要加载的夹具服务。

【问题讨论】:

标签: php symfony


【解决方案1】:

你需要更新(app/config/services.yml)

services:
        resource: '../../src/DataFixtures/*'

https://symfony.com/doc/master/bundles/DoctrineFixturesBundle/index.html

其他问题在上述教程中

// src/DataFixtures/AppFixtures.php
namespace App\DataFixtures;

命名空间应该是:

namespace DataFixtures;

【讨论】:

  • services: resource: '../../src/DataFixtures/*' 这部分在文档中缺失。
猜你喜欢
  • 2018-05-27
  • 2019-02-13
  • 1970-01-01
  • 2018-10-10
  • 2016-09-03
  • 1970-01-01
  • 1970-01-01
  • 2022-01-23
  • 2011-10-29
相关资源
最近更新 更多