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:
Sie können auf eine Variable so viele Modifikatoren anwenden
wie Sie möchten. Die Modifkatoren werden in der Reihenfolge
angewandt, in der sie notiert wurden - von links nach rechts.
Kombinierte Modifikatoren müssen mit einem
|
-Zeichen (pipe) getrennt werden.
Example 6.1. Kombinieren von Modifikatoren
<?php $smarty->assign('articleTitle', 'Einem Stadtrat in Salem in Pennsylvania (USA) droht eine zweijährige Haftstrafe, da eine von ihm gehaltene Rede sechs Minuten länger dauerte, als erlaubt. Die Redezeit ist auf maximal fünf Minuten begrenzt.'); ?>
Wobei das Template dann folgendes entält:
{$articleTitle} {$articleTitle|upper|spacify} {$articleTitle|lower|spacify|truncate} {$articleTitle|lower|truncate:30|spacify} {$articleTitle|lower|spacify|truncate:30:". . ."}
AUSGABE:
Einem Stadtrat in Salem in Pennsylvania (USA) droht eine (usw.) EINEM STADTRAT IN SALEM IN PENNSYLVANIA (USA) DROHT EINE (usw.) e i n e m s t a d t r a t i n s a l e m i n... e i n e m s t a d t r a t i n s a l e m i n . . . e i n e m s t a d t r. . .