Sylius 在 yaml 配置文件中使用哪种控制器命名格式?

What kind of controller naming format Sylius use in yaml config files?

f.e。让我们比较两个路由 yaml 文件:

ShopBundle/Resources/config/routing/product.yml

ShopBundle/Resources/config/routing/taxon.yml

都有_controller属性:

_controller: sylius.controller.product:showAction

_controller: sylius.controller.taxon:showAction

并且都匹配同一个控制器: ResourceBundle/Controller/ResourceController.php#L167

Sylius 使用控制器作为服务(参见:http://symfony.com/doc/current/controller/service.html). To easily find the related code to that service I suggest you to install the Symfony2 plugin for PHPStorm, you can find it here: https://plugins.jetbrains.com/plugin/7219?pr=idea

该插件使用缓存文件夹中的构建容器。所以你应该确保 symfony 已经正确地构建了你的定义一次。因此,请尝试 运行ning php app/console cache:clear 或简单地 运行 您的应用程序。

您应该使用 Ctrl + clickCmd + click,例如服务 ID、Twig 模板名称等。