$options->sortBy()
Alias for Kirby\Option\Options::sort()
$options->sortBy(string|callable $field, string|null $direction, int|null $method): Kirby\Option\Options
Parameters
Name | Type | Default | Description |
---|---|---|---|
$fieldrequired | string orcallable |
no default value | Field name or value callback to sort by |
$direction | string ornull |
no default value | asc or desc |
$method | int ornull |
no default value | The sort flag, SORT_REGULAR, SORT_NUMERIC etc. |
Return types
This method does not modify the existing $options
object but returns a new object with the changes applied. Learn more →
Parent class
Kirby\Option\Options
inherited from Kirby\Toolkit\Collection