Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d38d1b commit 9649800Copy full SHA for 9649800
components/finder.rst
@@ -170,8 +170,13 @@ Sort the result by name or by type (directories first, then files)::
170
171
.. tip::
172
173
- To sort by name using `natural sort order`_ algorithm,
174
- pass ``true`` as the first argument of ``sortByName()`` method.
+ By default, the ``sortByName()`` method uses the :phpfunction:`strcmp` PHP
+ function (e.g. ``file1.txt``, ``file10.txt``, ``file2.txt``). Pass ``true``
175
+ as its argument to use PHP's `natural sort order`_ algorithm instead (e.g.
176
+ ``file1.txt``, ``file2.txt``, ``file10.txt``).
177
+
178
+ .. versionadded:: 4.2
179
+ The option to use the natural sort order was introduced in Symfony 4.2.
180
181
You can also define your own sorting algorithm with ``sort()`` method::
182
0 commit comments