我正试图在head中获取Sylius主题中的图标图像。该图标位于Sylius主题/ assets中。现在,我通常可以在CSS文件中使用这些资产,但是我需要在layout.html.twig中导入它。无论我给它什么样的路,它都不起作用,我想知道它是否可能。我在这里做错什么了..?
我试着这样做,还有很多其他的方法:
<link rel="apple-icon" sizes="180x180" href="url(/build_dev/bootstrap-theme/images/apple-icon-180x180.png)">发布于 2022-08-13 15:14:29
我不确定,我是否理解你的问题正确。但是,我认为这能帮到你
您必须检查文件夹<kernel.root_path>/public/build_dev/bootstrap-theme/images/apple-icon-180x180.png
<img src="{{ asset('bootstrap-theme/images/apple-icon-180x180.png', 'bootstra-theme') }}" alt="Symfony!" />build_dev或build。见docs https://symfony.com/doc/current/reference/configuration/framework.html#assetshttps://stackoverflow.com/questions/72684671
复制相似问题