Skip to content

Instantly share code, notes, and snippets.

@odelrio
Last active November 12, 2015 10:40
Show Gist options
  • Save odelrio/6ac18151e442053ae35c to your computer and use it in GitHub Desktop.
Save odelrio/6ac18151e442053ae35c to your computer and use it in GitHub Desktop.
Smarty: br2nl modifier
There's no br2nl modifier in Smarty, but you can convert break tags to new line characters by using:
regex_replace:"/<br.?\/?>/":"\n"
E.g.:
<textarea value="{$myText|regex_replace:"/<br.?\/?>/":"\n"}"></textarea>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment