Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf9281f

Browse files
hmoreaujaviereguiluz
authored andcommitted
[Finder] Add case insensitive sort
1 parent04a65f6 commitdf9281f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎components/finder.rst‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,20 +339,24 @@ Sorting Results
339339
Sort the results by name, extension, size or type (directories first, then files)::
340340

341341
$finder->sortByName();
342+
$finder->sortByCaseInsensitiveName();
342343
$finder->sortByExtension();
343344
$finder->sortBySize();
344345
$finder->sortByType();
345346

346347
..versionadded::6.2
347348

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.
349350

350351
..tip::
351352

352353
By default, the ``sortByName()`` method uses the:phpfunction:`strcmp` PHP
353354
function (e.g. ``file1.txt``, ``file10.txt``, ``file2.txt``). Pass ``true``
354355
as its argument to use PHP's `natural sort order`_ algorithm instead (e.g.
355356
``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)
356360

357361
Sort the files and directories by the last accessed, changed or modified time::
358362

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp