PagesSortfields::decode()

Decodes a sortfield from a signed integer or string to a field name

The returned fieldname is preceded with a dash if the sortfield is reversed.

Usage

// basic usage
$string = $pagesSortfields->decode($sortfield);

// usage with all arguments
$string = $pagesSortfields->decode($sortfield, string $default = 'sort');

Arguments

NameType(s)Description
$sortfieldstring int
$default (optional)string

Default sortfield name Default:'sort'

Return value

string


PagesSortfields methods and properties

API reference based on ProcessWire core version 3.0.251