Fnr
Fnr

Reputation: 2274

Add Html content inside Html tag generated by linkAction call - Laravel

In my website using PHP and Laravel, I'm using the method Html::linkAction to route various requests given. The linkAction then is converted to an <a> element. Suppose I want to add more html tags inside that <a> content, how to do this? Or, is there a way to do this using this method?

I tried just {{ Html::linkAction('Controller@method', '<img src=..>'}} but then it shows literally the whole string <img src=..> instead of the actual image. Thanks in advance.

Upvotes: 0

Views: 155

Answers (1)

Sergii K
Sergii K

Reputation: 866

You can use URL::action() instead:

<a href="{{ URL::action('Controller@method') }}"><img src=..></a>

See this link.

Upvotes: 1

Related Questions