2016-11-25 62 views
0

我使用Twitter的引導模板在我的laravel應用。如何圖像添加到Twitter的引導與Laravel 5.2

我需要公用文件夾home.jpg中添加圖像,其中包括在我的IMGS文件夾。我如何將這個圖像添加到以下引導腳本。

<div class="item active"> 
    <img class="first-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="First slide"> 
    <div class="container"> 
    <div class="carousel-caption"> 
     <h1>Example headline.</h1> 
     <p>Note: If you're viewing this page via a <code>file://</code> URL, the "next" and "previous" Glyphicon buttons on the left and right might not load/display properly due to web browser security rules.</p> 
     <p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p> 
    </div> 
    </div> 
</div> 

回答

0

Laravel默認情況下需要公衆文件夾路徑公共/

比方說,你home.jpg文件是公共/圖像/ home.jpg

所以在你的HTML它會是<img src="http://localhost:8000/image/home.jpg">

Laravel也有特定的梅索德{{ HTML::image('image/home.jpg') }}這一點。

對於單純指http://laravel-recipes.com/recipes/185/generating-an-html-image-element

0

OK最後我得到了解決辦法,這是工作

<img class="first-slide" src="{{asset('/imgs/1.gif')}} " alt="First slide">