I'm trying to create an image link with the HTML helper of Laravel 4. But it seems that isn't really working. I have this line of code
{{ HTML::link("#", HTML::image("img/logo.png", "Logo") ) }}
But that just outputs a strin like this:
<img src="http://localhost/worker/public/img/logo" alt="Logo">
How come.??
Additional to correct answer also you can add some attribute like height and width
HTML helper has been removed from Laravel 5
now you could simple use this
This asset by default point to public folder of your larval application
I think it's overkill for no reason. I would do:
If I then need a dynamic link in place of the #, I would do:
Try to use html as much as you can.
You could also use html_entity_decode to get your code working
You probably will have to:
Because, link() uses entities to escape the title:
Producing this source code: