mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-03 22:17:36 +00:00
Update u.rst to clarify truncate method's third argument behavior
Current wording "to preserve whole words" suggests setting the argument to ``true`` preserves words. However, the parameter is ``$cut`` (defaults to ``true`` for cutting at exact length), and ``false`` is required to preserve whole words.
This commit is contained in:
committed by
GitHub
parent
94abd1c39b
commit
28c2606be7
+1
-1
@@ -31,7 +31,7 @@ Truncating a string:
|
||||
{{ 'Lorem ipsum'|u.truncate(8, '...') }}
|
||||
Lorem...
|
||||
|
||||
The ``truncate`` method also accepts a third argument to preserve whole words:
|
||||
By default, ``truncate`` cuts text at the exact length. Pass ``false`` as the third argument to preserve whole words:
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
|
||||
Reference in New Issue
Block a user