System:Preferences:addSort

From Aspen Documentation

Adds a new sort preference to the database.

Since 1.0

Arguments

void addSort ([string $location = false], [string $field = false], [string $dir = 'ASC'])

location
A unique key that identifies this sort with a specific location - a table, query, etc.
field
Sort by field name.
dir
Sort by direction (ASC / DESC)

Returns

This function does not return a value.

Examples

Saving a sort preference usually involves passing in at least the sort field from the URL.

 $this->APP->prefs->addSort('users:list', 'username', 'DESC');