TYPO3 Symfony\Component\DependencyInjection\Exception\RuntimeException

5sxhfpxr  于 2023-10-24  发布在  其他
关注(0)|答案(1)|浏览(125)

这是我收到的错误信息!
这是什么意思,没有这样的服务存在吗?
下面是SpeciesSelectController的代码:

<?php
declare(strict_types=1);

namespace HGA\Hgaplantdb\Controller;

use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use \Psr\Http\Message\ResponseInterface;
use \HGA\Hgaplantdb\Controller;

/**
 * SpeciesSelectController
 */
class SpeciesSelectController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {

    /**
     * SpeciesSelectRepository
     * 
     * @var \HGA\Hgaplantdb\Domain\Repository\SpeciesSelectRepository
     */
    protected $speciesSelectRepository = null;

    /**
     * @param \HGA\Hgaplantdb\Controller\Domain\Repository\SpeciesSelectRepository $speciesSelectRepository
     */
    public function injectSpeciesSelectRepository(\HGA\Hgaplantdb\Domain\Repository\SpeciesSelectRepository $speciesSelectRepository)
    {
        $this->speciesSelectRepository = $speciesSelectRepository;
    }

下面是Services.yaml文件:

# Configuration/Services.yaml
services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  HGA\Hgaplantdb\:
    resource: '..\Classes\*'
    exclude: '..\Classes\Domain\Model\*'

  HGA\Hgaplantdb\Controller\SpeciesSelectController:
    public: true

  HGA\Hgaplantdb\Controller\PlantController:
    public: true

也问过谷歌后,我目前也不知道,到底是怎么回事!

epfja78i

epfja78i1#

由于另一个问题与不同的扩展名,我在想,对于windows我不得不使用\而不是/Service.yaml文件.但这是一个错误!

HGA\Hgaplantdb\:
    resource: '../Classes/*'
    exclude: '../Classes/Domain/Mode/*'

它工作正常。这里是完整的更正文件:

# Configuration/Services.yaml
services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  HGA\Hgaplantdb\:
    resource: '../Classes/*'
    exclude: '../Classes/Domain/Mode/*'

  HGA\Hgaplantdb\Controller\SpeciesSelectController:
    public: true

  HGA\Hgaplantdb\Controller\PlantController:
    public: true

相关问题