2017-02-28 95 views
0

我最近开始尝试使用Bolt-cms,一切都进行得很顺利,但是这个:我试图给我的模板添加一些硬编码的图片,但是它们没有显示出来。它看起来像路径错误。导演的图片没有显示

<img src="img/test.jpg" > 

<img src="{{root}}/img/test.jpg" > 

似乎并不工作。

有人知道正确的做法是?

回答

0

我们使用Symfony Asset,docs here

但短版:

<script src="{{ asset('js/jquery.min.js', 'theme') }}"></script> 
# Include jquery.min.js from the js folder in your theme. 

<img src="{{ asset('kitten.jpg', 'files') }}"></script> 
# Display the kitten.jpg image, that was uploaded to the `files/` folder.