2017-02-28 94 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.