PHP Coding Tips

Tuesday, August 7, 2012

Filter smarty variable in .TPL file for new lines to br tag

You can filter any smarty variable by using allowed php function as a modifier. For example to put BR tags instead new lines you can do this in smarty template:{$content|nl2br}Good way to output filter or (if you provide own modifier) you can format dates etc.

23 comments: