diff options
author | Mario Vavti <mario@mariovavti.com> | 2022-03-29 11:42:53 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2022-03-29 11:42:53 +0200 |
commit | 0784cd593a39a4fc297e8a82f7e79bc8019a0868 (patch) | |
tree | 22182afb37cf460f8208fff9d276a0672add3185 /vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-wordwrap.md | |
parent | 0e2e9321025f87fe9587f3d183adaea6185e4e20 (diff) | |
parent | 9c5d2ee5630dd7033904039dcd1e92db8821b644 (diff) | |
download | volse-hubzilla-0784cd593a39a4fc297e8a82f7e79bc8019a0868.tar.gz volse-hubzilla-0784cd593a39a4fc297e8a82f7e79bc8019a0868.tar.bz2 volse-hubzilla-0784cd593a39a4fc297e8a82f7e79bc8019a0868.zip |
Merge branch '7.2RC'7.2
Diffstat (limited to 'vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-wordwrap.md')
-rw-r--r-- | vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-wordwrap.md | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-wordwrap.md b/vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-wordwrap.md new file mode 100644 index 000000000..97cd774f7 --- /dev/null +++ b/vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-wordwrap.md @@ -0,0 +1,69 @@ +wordwrap {#language.modifier.wordwrap} +======== + +Wraps a string to a column width, the default is 80. As an optional +second parameter, you can specify a string of text to wrap the text to +the next line, the default is a carriage return `"\n"`. By default, +`wordwrap` will attempt to wrap at a word boundary. If you want to cut +off at the exact character length, pass the optional third parameter as +TRUE. This is equivalent to the PHP +[`wordwrap()`](&url.php-manual;wordwrap) function. + + Parameter Position Type Required Default Description + -------------------- --------- ---------- --------- ------------------------------------------------------------------------------------------------------ + 1 integer No 80 This determines how many columns to wrap to. + 2 string No \\n This is the string used to wrap words with. + 3 boolean No FALSE This determines whether or not to wrap at a word boundary (FALSE), or at the exact character (TRUE). + + + <?php + + $smarty->assign('articleTitle', + "Blind woman gets new kidney from dad she hasn't seen in years." + ); + + ?> + + + +Where template is + + + {$articleTitle} + + {$articleTitle|wordwrap:30} + + {$articleTitle|wordwrap:20} + + {$articleTitle|wordwrap:30:"<br />\n"} + + {$articleTitle|wordwrap:26:"\n":true} + + + +Will output: + + + Blind woman gets new kidney from dad she hasn't seen in years. + + Blind woman gets new kidney + from dad she hasn't seen in + years. + + Blind woman gets new + kidney from dad she + hasn't seen in + years. + + Blind woman gets new kidney<br /> + from dad she hasn't seen in<br /> + years. + + Blind woman gets new kidn + ey from dad she hasn't se + en in years. + + + +See also [`nl2br`](#language.modifier.nl2br) and +[`{textformat}`](#language.function.textformat). |