私は例 https://symfony.com/doc/current/event_dispatcher.html#content_wrappersymfonyの3.3.9リスナーないcalles
のような単純なリスナーの例を持っている1:1
services.ymlは同じ
services:
# default configuration for services in *this* file
_defaults:
# automatically injects dependencies in your services
autowire: true
# automatically registers your services as commands, event subscribers, etc.
autoconfigure: true
# this means you cannot fetch services directly from the container via $container->get()
# if you need to do this, you can override this setting on individual services
public: false
# makes classes in src/AppBundle available to be used as services
# this creates a service per class whose id is the fully-qualified class name
# AppBundle\:
# resource: '../../src/AppBundle/*'
# # you can exclude directories or files
# # but if a service is unused, it's removed anyway
# exclude: '../../src/AppBundle/{Entity,Repository,Tests}'
AppBundle\:
resource: '../../src/AppBundle/*'
# you can exclude directories or files
# but if a service is unused, it's removed anyway
exclude: '../../src/AppBundle/{Entity,Repository}'
# controllers are imported separately to make sure they're public
# and have a tag that allows actions to type-hint services
# AppBundle\Controller\:
# resource: '../../src/AppBundle/Controller'
# public: true
# tags: ['controller.service_arguments']
AppBundle\Controller\:
resource: '../../src/AppBundle/Controller'
public: true
tags: ['controller.service_arguments']
ですがリスナーは「呼び出されていないリスナー」と表示されます
私は間違っていますか?それは与えられたインタフェースを実装する場合
が優先問題になる可能性があります属性なしで自動設定は、タグのみで動作します。エラーメッセージは、リスナーが認識されて追加されたことを示します。私はあなたが正しいメソッド名を持っていると仮定します。したがって、優先度の高い別のリスナーが最初に呼び出されてからイベントをキャンセルする可能性があります。 bin/consoleデバッグ:イベントディスパッチャが役立つ可能性があります。 – Cerad