Sort columns by name or label
| name | income |
|---|---|
| John | 50,000 |
| Marry | 60,000 |
| Peter | 100,000 |
| Donald | 80,000 |
->pipe(new ColumnsSort(array(
"{name}" => "asc",
// "{label}" => "desc",
// "{name}" => function ($a, $b) { return $a < $b ? -1 : 1; },
// "{label}" => function ($a, $b) { return $a < $b ? 1 : -1; },
)))
| income | name |
|---|---|
| 50,000 | John |
| 60,000 | Marry |
| 100,000 | Peter |
| 80,000 | Donald |