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.

35 comments:

  1. <a href="https://fenunalmthaleya.com/%d8%b4%d8%b1%d9%83%d8%a9-%d8%b9%d8%b2%d9%84-%d8%a7%d8%b3%d8%b7%d8%ad

    ReplyDelete