Core Sorting
The Sorting class creates an object which allows to easy create and display sorted views. The intention is to use this class everywhere in Contrexx as a gateway for sortings.
This class saves sortings in the user's session, also for different views.
Methods
- function __construct(&$baseUri, $arrField, $flagDefaultAsc=true, $orderUriParameter=self::DEFAULT_PARAMETER_NAME)
- Constructs a sorting with the given uri
- Fields are in the array as ("FieldName" => "displayed name")
- Fieldnams can be in a SQL syntax: id, 'id' or 'table'.'id'
- function getUri_entities($field=null)
- Returns the URL with the current sorting (NULL) or with the provided field
- Usage e.g. as URL for the paging, so the sorting will still be set.
- function getOrderReverseUriEncoded($field=null)
- Returns the URL with the current sorting (NULL) or with the provided field, but in the inverse order
- function getHeaderArray()
- Returns an array (FieldName => HTML for the head field) for all fields
- function getHeaderForField($field)
- Returns the String with the HTML for the head field
Examples
More examples are available in the shop since Contrexx version 3.0