File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -339,20 +339,24 @@ Sorting Results
339
339
Sort the results by name, extension, size or type (directories first, then files)::
340
340
341
341
$finder->sortByName();
342
+ $finder->sortByCaseInsensitiveName();
342
343
$finder->sortByExtension();
343
344
$finder->sortBySize();
344
345
$finder->sortByType();
345
346
346
347
.. versionadded :: 6.2
347
348
348
- The ``sortByExtension() `` and ``sortBySize() `` methods were introduced in Symfony 6.2.
349
+ The ``sortByCaseInsensitiveName() ``, `` sortByExtension() `` and ``sortBySize() `` methods were introduced in Symfony 6.2.
349
350
350
351
.. tip ::
351
352
352
353
By default, the ``sortByName() `` method uses the :phpfunction: `strcmp ` PHP
353
354
function (e.g. ``file1.txt ``, ``file10.txt ``, ``file2.txt ``). Pass ``true ``
354
355
as its argument to use PHP's `natural sort order `_ algorithm instead (e.g.
355
356
``file1.txt ``, ``file2.txt ``, ``file10.txt ``).
357
+
358
+ The ``sortByCaseInsensitiveName() `` method uses the case insensitive :phpfunction: `strcasecmp ` PHP function.
359
+ Pass ``true `` as its argument to use PHP's case insensitive `natural sort order `_ algorithm instead (the :phpfunction: `strnatcasecmp ` PHP function)
356
360
357
361
Sort the files and directories by the last accessed, changed or modified time::
358
362
You can’t perform that action at this time.
0 commit comments