Setting the Escaped Content Tags Blade Uses


You want to use different escaped content tags in your Blade template.

You know that blade uses {{{ and }}} to specify content to be escaped and output, but you want to use something different.


Use the Blade::setEscapedContentTags() method.

Let's say you want to use [{{ and }}] for your tags. First call the method.

Blade::setContentTags('[{{', '}}]');

Then your template can contain code like.

The value of $variable is [{{ $variable }}].

$variable will pass through HTML::entities() before being output.


This actually calls Blade::setContentTags().

It passes the third argument as true. See Setting the Content Tags Blade Uses.

comments powered by Disqus