mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 20:06:31 +00:00
minor #1422 Update slice.rst (1emming)
This PR was merged into the 1.16-dev branch.
Discussion
----------
Update slice.rst
Please state that Twig `slice` is multi-byte safe since it uses `mb_substr` :)
Commits
-------
87165e7 Update slice.rst
This commit is contained in:
@@ -41,7 +41,7 @@ As syntactic sugar, you can also use the ``[]`` notation:
|
||||
{{ '12345'[2:] }} {# will display "345" #}
|
||||
|
||||
The ``slice`` filter works as the `array_slice`_ PHP function for arrays and
|
||||
`substr`_ for strings.
|
||||
`mb_substr`_ for strings with a fallback to `substr`_.
|
||||
|
||||
If the start is non-negative, the sequence will start at that start in the
|
||||
variable. If start is negative, the sequence will start that far from the end
|
||||
@@ -67,4 +67,5 @@ Arguments
|
||||
|
||||
.. _`Traversable`: http://php.net/manual/en/class.traversable.php
|
||||
.. _`array_slice`: http://php.net/array_slice
|
||||
.. _`mb_substr` : http://php.net/mb-substr
|
||||
.. _`substr`: http://php.net/substr
|
||||
|
||||
Reference in New Issue
Block a user