Support the ongoing development of Laravel.io →
Views Blade Forms
Last updated 2 years ago.
0

Try

<img src="{{ $article->image }}" />
Last updated 2 years ago.
0

mrterryh said:

Try

Hi mrterryh,

Would I just add "images/mypath" insde the braces to get it to work?

Thanks!

Last updated 2 years ago.
0

There is also an HTML helper for images...

{{ HTML::image('images/mypath'.$article->image) }}

http://laravel.com/api/source-class-Illuminate.Html.HtmlBuilder.html#98-111

Last updated 2 years ago.
0

That did the trick! Thanks AndrewBNZ and mrterryh :)

Last updated 2 years ago.
0

Just to clarify the way that the blade syntax works:

{{ $article->image }}

is just a replacement for:

<?php echo $article->image; ?>

therefore you don't need to include the echo part if you are outputting HTML; that's part of what blade does for you. For example in your example you would do the following:

<img src="/images/mypath/{{ $article->image }}">

which is translated to

<img src="/images/mypath/<?php echo $article->image; ?>">

behind the scenes.

Last updated 2 years ago.
0

Thanks for clarifying citricsquid!

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Reached reached Joined 27 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.