Function __global->results_table

Definitions

sources/templates_results_table.php

  • Get the Tempcode for a results table.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$text_id mixed No No required parameter N/A N/A Some text/word describing what is being browsed (string or Tempcode)
$start integer No No required parameter N/A N/A The result number our table starts at (x of n)
$start_name ID_TEXT No No required parameter N/A N/A The parameter name used to store our position in the results (usually, 'start')
$max integer No No required parameter N/A N/A The total number of results to show per-page
$max_name ID_TEXT No No required parameter N/A N/A The parameter name used to store the total number of results to show per-page (usually, 'max')
$max_rows integer No No required parameter N/A N/A The maximum number of rows in the entire dataset
$header_row Tempcode No No required parameter N/A N/A The titles of the fields we are showing in our table, presented in pre-prepared Tempcode
$result_entries Tempcode No No required parameter N/A N/A The entry rows we are showing in our table
$sortables array No No [] N/A N/A A map of sortable code (usually, db field names), to strings giving the human name for the sort order
$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)
$message ?Tempcode No No Null N/A N/A Message to show; you want to set this to new Tempcode() if you do not want any message to show (null: auto)
$widths array No No [] N/A N/A Widths to specify to the table (strings, ending 'px')
$tpl_set ?string No No Null N/A N/A The template set to use (null: default)
$max_pagination_links ?integer No No Null N/A N/A The maximum number of quick-jump pagination-links to show (null: configured default)
$guid string No No 1c8645bc2a3ff5bec2e003142185561f N/A N/A GUID to pass to template
$skip_sortables_form boolean No No False N/A N/A Whether to skip showing a sort form (useful if there is another form wrapped around this)
$hash ?ID_TEXT No No Null N/A N/A URL hash component without the # (null: none)
$interactive boolean No No False N/A N/A Whether to allow interactive sorting and filtering
$responsive boolean No No True N/A N/A Whether the table should be responsive
$footer_row ?Tempcode No No Null N/A N/A The footer row of the fields we are showing in our table, presented in pre-prepared Tempcode (null: do not show a footer)

Returns

  • The results table
  • Type: Tempcode
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get the Tempcode for a results table.
 *
 * @param  mixed $text_id Some text/word describing what is being browsed (string or Tempcode)
 * @param  integer $start The result number our table starts at (x of n)
 * @param  ID_TEXT $start_name The parameter name used to store our position in the results (usually, 'start')
 * @param  integer $max The total number of results to show per-page
 * @param  ID_TEXT $max_name The parameter name used to store the total number of results to show per-page (usually, 'max')
 * @param  integer $max_rows The maximum number of rows in the entire dataset
 * @param  Tempcode $header_row The titles of the fields we are showing in our table, presented in pre-prepared Tempcode
 * @param  Tempcode $result_entries The entry rows we are showing in our table
 * @param  array $sortables A map of sortable code (usually, db field names), to strings giving the human name for the sort order
 * @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  ?Tempcode $message Message to show; you want to set this to new Tempcode() if you do not want any message to show (null: auto)
 * @param  array $widths Widths to specify to the table (strings, ending 'px')
 * @param  ?string $tpl_set The template set to use (null: default)
 * @param  ?integer $max_pagination_links The maximum number of quick-jump pagination-links to show (null: configured default)
 * @param  string $guid GUID to pass to template
 * @param  boolean $skip_sortables_form Whether to skip showing a sort form (useful if there is another form wrapped around this)
 * @param  ?ID_TEXT $hash URL hash component without the # (null: none)
 * @param  boolean $interactive Whether to allow interactive sorting and filtering
 * @param  boolean $responsive Whether the table should be responsive
 * @param  ?Tempcode $footer_row The footer row of the fields we are showing in our table, presented in pre-prepared Tempcode (null: do not show a footer)
 * @return Tempcode The results table
 */

function results_table($text_id, int $start, string $start_name, int $max, string $max_name, int $max_rows, object $header_row, object $result_entries, array $sortables = [], ?string $sortable = null, ?string $sort_order = null, ?string $sort_name = 'sort', ?object $message = null, array $widths = [], ?string $tpl_set = null, ?int $max_pagination_links = null, string $guid = '1c8645bc2a3ff5bec2e003142185561f', bool $skip_sortables_form = false, ?string $hash = null, bool $interactive = false, bool $responsive = true, ?object $footer_row = null) : object