Function __global->results_sorter
Definitions
sources/templates_results_table.php
- Get the Tempcode for a results sorter.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: object
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $sortables | array | No | No | required parameter | N/A | N/A | A map of sortable code (usually, db field names), to strings giving the human name for the sort order or a pair of such and which direction to limit to |
| $sortable | ?ID_TEXT | No | No | Null | N/A | N/A | The current sortable (null: none) |
| $sort_order | ?ID_TEXT | No | No | Null | ASC DESC | N/A | The order we are sorting in (null: none) |
| $sort_name | ?ID_TEXT | No | No | sort | N/A | N/A | The parameter name used to store our sortable (usually 'sort') (null: none) |
| $hash | ?ID_TEXT | No | No | Blank (empty string) | N/A | N/A | URL hash component without the # (null: none) |
Returns
- The results sorter
- Type: Tempcode
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get the Tempcode for a results sorter.
*
* @param array $sortables A map of sortable code (usually, db field names), to strings giving the human name for the sort order or a pair of such and which direction to limit to
* @param ?ID_TEXT $sortable The current sortable (null: none)
* @param ?ID_TEXT $sort_order The order we are sorting in (null: none)
* @set ASC DESC
* @param ?ID_TEXT $sort_name The parameter name used to store our sortable (usually 'sort') (null: none)
* @param ?ID_TEXT $hash URL hash component without the # (null: none)
* @return Tempcode The results sorter
*/
function results_sorter(array $sortables, ?string $sortable = null, ?string $sort_order = null, ?string $sort_name = 'sort', ?string $hash = '') : object
* Get the Tempcode for a results sorter.
*
* @param array $sortables A map of sortable code (usually, db field names), to strings giving the human name for the sort order or a pair of such and which direction to limit to
* @param ?ID_TEXT $sortable The current sortable (null: none)
* @param ?ID_TEXT $sort_order The order we are sorting in (null: none)
* @set ASC DESC
* @param ?ID_TEXT $sort_name The parameter name used to store our sortable (usually 'sort') (null: none)
* @param ?ID_TEXT $hash URL hash component without the # (null: none)
* @return Tempcode The results sorter
*/
function results_sorter(array $sortables, ?string $sortable = null, ?string $sort_order = null, ?string $sort_name = 'sort', ?string $hash = '') : object

