使用$ this-> headLink() - > appendStylesheet(' /path/xyz.css');在Pimcore 5

时间:2017-09-27 08:10:02

标签: php pimcore

我刚刚在Pimcore 5中创建了我的view.html.php脚本。 不幸的是,无法集成CSS数据。 <link rel="stylesheet" type="text/css" href="../static...的手册没问题。

例如,我用过:

$this->headLink()->appendStylesheet('/static/bootstrap/css/bootstrap.css');

文件bootstrap.css存在。

例外:

  

尝试调用名为&#34; headLink&#34;的未定义方法。 class&#34; Symfony \ Component \ Debug \ DebugClassLoader&#34;。

截图:

有人可以帮忙吗?有人知道吗?

1 个答案:

答案 0 :(得分:0)

你在哪里使用它?根据你的截图,你试图在pimcore / lib / Pimcore / Templating / Helper / Headlink.php中调用它,这是错误的。

您应该在view.html.php或layout.html

中使用它