Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
3de072ca
Commit
3de072ca
authored
Nov 29, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed constant references in array helper guide
parent
9565b996
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
helper-array.md
docs/guide/helper-array.md
+3
-3
No files found.
docs/guide/helper-array.md
View file @
3de072ca
...
...
@@ -185,7 +185,7 @@ $data = [
[
'age'
=>
30
,
'name'
=>
'Brian'
],
[
'age'
=>
19
,
'name'
=>
'Barney'
],
];
ArrayHelper
::
multisort
(
$data
,
[
'age'
,
'name'
],
[
ArrayHelper
::
SORT_ASC
,
ArrayHelper
::
SORT_DESC
]);
ArrayHelper
::
multisort
(
$data
,
[
'age'
,
'name'
],
[
SORT_ASC
,
SORT_DESC
]);
```
After sorting we'll get the following in
`$data`
:
...
...
@@ -207,8 +207,8 @@ ArrayHelper::multisort($data, function($item) {
});
```
Third argument is direction. In case of sorting by a single key it could be either
`
ArrayHelper::
SORT_ASC`
or
`
ArrayHelper::
SORT_DESC`
. If sorting by multiple values you can sort each value differently by providing an array of
Third argument is direction. In case of sorting by a single key it could be either
`SORT_ASC`
or
`SORT_DESC`
. If sorting by multiple values you can sort each value differently by providing an array of
sort direction.
Last argument is PHP sort flag that could take the same values as the ones passed to
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment