nrofis
nrofis

Reputation: 9796

Laravel blade not escaping HTML

I am using Laravel 5.2 and for some reason the blade standard tags {{...}} are not escaping HTML as wrote in the documentation.

When I tries to write for example {{ HTML::tag('span','hello') }} I get the correct HTML and see hello in my browser. The I get same results if I write {!! HTML::tag('span','hello') !!}.

So why the {{...}} tags does not escaping the HTML tags, as they should?

Upvotes: 2

Views: 1945

Answers (1)

Laravel User
Laravel User

Reputation: 1129

you should use {{...}} for variable printing.

and {!!...!!} this for normal html. you can just write plain html without braces and it will show correctly.

Upvotes: 1

Related Questions