Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

This course is the most refreshing take on teaching design that I've come across.

— Mikaël Sévigny, Developer

add_slashes Modifier

Modifies a string by adding backslashes before characters that need to be escaped. These characters are:

  • single quote '
  • double quote "
  • backslash \

This is most often used when passing string data into JavaScript.

summary: >
"I'm not listening!" said the small, strange creature.
{{ summary | add_slashes }}
\"I\'m not listening!\" said the small, strange creature.
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →
Hello there! Are you looking for the Statamic v2 documentation?