【问题标题】:Navigate Sylius theme templates in PhpStorm在 PhpStorm 中导航 Sylius 主题模板
【发布时间】:2021-12-08 14:11:06
【问题描述】:

当我构建自己的 Sylius 主题时 然后我按下 CMD 按钮单击模板名称 然后我希望能够导航到我的主题中的那个模板:themes/ThemeName/templates/bundles/SyliusShopBundle/Layout/Header/_logo.html.twig 但它不存在于弹出选择中:

如何解决?

【问题讨论】:

    标签: symfony twig themes phpstorm sylius


    【解决方案1】:

    创建文件

    themes/ThemeName/ide-twig.json

    接下来的内容:

    {
      "namespaces": [
        {
          "path": "templates/bundles/SyliusAdminBundle",
          "namespace": "SyliusAdmin"
        },
        {
          "path": "templates/bundles/SyliusShopBundle",
          "namespace": "SyliusShop"
        },
        {
          "path": "templates/bundles/SyliusUiBundle",
          "namespace": "SyliusUi"
        }
      ]
    }
    

    之后 - 显示预期的选择,我可以通过两次点击进行导航:

    如果某些东西不起作用 - 可能您的 JSON 文件有拼写错误(例如,最后的项目不应以逗号结尾)。

    灵感来自https://tomasvotruba.com/blog/2019/01/28/2-files-that-your-symfony-application-misses/

    【讨论】:

      猜你喜欢
      • 2021-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多