Skip to content Skip to footer navigation
🏰 Statamic Summit 2027 Feb 16–19 Talks, workshops, and three nights in a German castle. Get Tickets

Entities Modifier

Encode a string with HTML entities via PHP's htmlentities() function. This is the opposite of the decode modifier.

string: "The 'bacon' is <b>crispy</b>"
{{ string | entities }}
{!! Statamic::modify($string)->entities() !!}
The &#039;bacon&#039; is &lt;b&gt;crispy&lt;/b&gt;