Function __global->build_page_link

Definitions

sources/urls.php

  • Build and return a proper page-link, from the $parameters array.Note: URL parameters should always be in lower case (one of the coding standards).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$parameters array No No required parameter N/A N/A A map of parameter names to parameter values. E.g. ['page'=>'example','type'=>'foo','id'=>2]. Values may be strings or integers, or Tempcode, or null. null indicates "skip this". 'page' cannot be null.
$zone_name ID_TEXT No No Blank (empty string) N/A N/A The zone the URL is pointing to. YOU SHOULD NEVER HARD CODE THIS- USE '_SEARCH', '_SELF' (if you're self-referencing your own page) or the output of get_module_zone.
$skip array No No [] N/A N/A Parameters to explicitly to explicitly not put in the URL (perhaps because we have $keep_all set, or we are blocking certain keep_ values). The format is of a map where the keys are the names, and the values are true.
$hash string No No Blank (empty string) N/A N/A Hash portion of the URL (blank: none). May or may not start '#' - code will put it on if needed

Returns

  • The page-link
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Build and return a proper page-link, from the $parameters array.Note: URL parameters should always be in lower case (one of the coding standards).
 *
 * @param  array $parameters A map of parameter names to parameter values. E.g. ['page'=>'example','type'=>'foo','id'=>2]. Values may be strings or integers, or Tempcode, or null. null indicates "skip this". 'page' cannot be null.
 * @param  ID_TEXT $zone_name The zone the URL is pointing to. YOU SHOULD NEVER HARD CODE THIS- USE '_SEARCH', '_SELF' (if you're self-referencing your own page) or the output of get_module_zone.
 * @param  array $skip Parameters to explicitly to explicitly not put in the URL (perhaps because we have $keep_all set, or we are blocking certain keep_ values). The format is of a map where the keys are the names, and the values are true.
 * @param  string $hash Hash portion of the URL (blank: none). May or may not start '#' - code will put it on if needed
 * @return string The page-link
 */

function build_page_link(array $parameters, string $zone_name = '', array $skip = [], string $hash = '') : string