如何使用Symfony\Component\Routing\Annotation\Route?

How to use Symfony\Component\Routing\Annotation\Route?

我在模块部分的 Prestashop 管理面板中收到以下错误,不允许我配置任何模块。

启用 "sensio_framework_extra.router.annotations" 配置自 5.2 版起已弃用。将其设置为 false 并使用 Symfony 本身的 "Symfony\Component\Routing\Annotation\Route" 注释。 隐藏上下文显示跟踪

[▼
  "exception" => SilencedErrorContext {#5077 ▼
    +count: 1
    -severity: E_USER_DEPRECATED
    trace: {▼
      /home/desigssq/public_html/new17/vendor/sensio/framework-extra-bundle/DependencyInjection/SensioFrameworkExtraExtension.php:41 {▼
        › if ($config['router']['annotations']) {
        ›     @trigger_error(sprintf('Enabling the "sensio_framework_extra.router.annotations" configuration is deprecated since version 5.2. Set it to false and use the "%s" annotation from Symfony itself.', \Symfony\Component\Routing\Annotation\Route::class), E_USER_DEPRECATED);
        › 
      }
      /home/desigssq/public_html/new17/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:71 {▼
        › 
        ›     $extension->load($config, $tmpContainer);
        › } catch (\Exception $e) {
      }
    }
  }
]

将以下行添加到您的 config.yml 文件中:

sensio_framework_extra:
    router:
         annotations: false