What is Smarty?
Why use it?
Use Cases and Work Flow
Syntax Comparison
Template Inheritance
Best Practices
Crash Course
You may use the Smarty logo according to the trademark notice.
For sponsorship, advertising, news or other inquiries, contact us at:
Parameter Position | Typ | Benötigt | Standard | Beschreibung |
---|---|---|---|---|
1 | bool | Nein | true | Definiert ob Tags durch ' ' oder '' ersetzt werden sollen. |
Entfernt alle Markup tags. - Eigentlich alles zwischen < und >.
Example 5.20. strip_tags
<?php $smarty = new Smarty; $smarty->assign('articleTitle', "Da ein <font face="helvetica">betrunkener Mann</font> auf einem Flug ausfallend wurde, musste <b>das Flugzeug</b> auf einer kleinen Insel zwischenlanden und den Mann aussetzen."); $smarty->display('index.tpl'); ?>
where index.tpl is:
{$articleTitle} {$articleTitle|strip_tags} {* same as {$articleTitle|strip_tags:true} *} {$articleTitle|strip_tags:false}
This will output:
Da ein <font face="helvetica">betrunkener Mann</font> auf einem Flug ausfallend wurde, musste <b>das Flugzeug</b> auf einer kleinen Insel zwischenlanden und den Mann aussetzen. Da ein betrunkener Mann auf einem Flug ausfallend wurde, musste das Flugzeug auf einer kleinen Insel zwischenlanden und den Mann aussetzen. Da ein <font face="helvetica">betrunkener Mann</font> auf einem Flug ausfallend wurde, musste <b>das Flugzeug</b> auf einer kleinen Insel zwischenlanden und den Mann aussetzen.