gprusiiski
gprusiiski

Reputation: 450

Laravel use html as anchor text in HTML::linkRoute

I`m having a problem using laravel blade html helper do geenrate a link. The thing that i want to do is to use html "" as the anchor body, and i want this html to be rendered. I am calling the link as follows:

{{HTML::linkRoute('admin.event.edit', '<span class="glyphicon glyphicon-edit"></span>', $event->id) }}

The problem is that the pages show this:

<a href="****/event/2/edit">&lt;span class="glyphicon glyphicon-edit"&gt;&lt;/span&gt;</a>

The question is : How can i tell the HTML::linkRoute to parse the content of the anchor tag.

Thanks for the time. If you need more information as in the comment section. Best Regards, Georgi.

Upvotes: 0

Views: 2153

Answers (1)

Antoine Augusti
Antoine Augusti

Reputation: 1608

This would do the trick, but it's not beautiful.

{{ HTML::decode(HTML::linkRoute('admin.event.edit', '<span class="glyphicon glyphicon-edit"></span>', $event->id)) }}

You could also create a macro like in this answer: laravel 4: How insert raw HTML to label?

Upvotes: 5

Related Questions