Get image name from database in laravel -


i have database, columns image , alttag. want use them in laravel blade view. try this:

{{ html::image('images/{{ $item->image }}', $alt="{{ $item->alttag }}") }} 

but syntax isn't correct. if echo image , alttag this:

<h1>{{ $item->alttag }}</h1> 

then correct. wonder wrong in code.

you used blade syntax in php string. watch compiled blade templates see did go wrong.

in short. try this:

{{ html::image('images/'. $item->image, $alt = $item->alttag) }} 

or equally short:

{{ html::image("images/{$item->image}", $alt = $item->alttag) }} 

Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -