Function __global->_build_url

Definitions

sources/urls.php

  • Build and return a proper URL, 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. Values may be strings or integers, 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 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.
$keep_all boolean No No False N/A N/A Whether to keep all non-skipped parameters that were in the current URL, in this URL
$avoid_remap boolean No No False N/A N/A Whether to avoid URL Schemes (sometimes essential so we can assume the standard URL parameter addition scheme in templates)
$skip_keep boolean No No False N/A N/A Whether to skip actually putting on keep_ parameters (rarely will this skipping be desirable)
$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 URL in string format
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Build and return a proper URL, 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. Values may be strings or integers, 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 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  boolean $keep_all Whether to keep all non-skipped parameters that were in the current URL, in this URL
 * @param  boolean $avoid_remap Whether to avoid URL Schemes (sometimes essential so we can assume the standard URL parameter addition scheme in templates)
 * @param  boolean $skip_keep Whether to skip actually putting on keep_ parameters (rarely will this skipping be desirable)
 * @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 URL in string format
 */

function _build_url(array $parameters, string $zone_name = '', array $skip = [], bool $keep_all = false, bool $avoid_remap = false, bool $skip_keep = false, string $hash = '') : string