Function __global->find_id_moniker

Definitions

sources/urls.php

  • Find the textual moniker for a typical software URL path. This will be called from inside build_url, based on details learned from a moniker hook (only if a hook exists to hint how to make the requested link SEO friendly).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$url_parts array No No required parameter N/A N/A The URL component map (must contain 'page', 'type', and 'id' if this function is to do anything)
$zone ID_TEXT No No required parameter N/A N/A The URL zone name (only used for Comcode Page URL monikers)
$search_redirects boolean No No True N/A N/A Whether to consider that the page may have been redirected. We'll generally set this to false when linking, as we know that redirects will be considered elsewhere in the stack anyway

Returns

  • The moniker ID (null: could not find)
  • Type: ?string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find the textual moniker for a typical software URL path. This will be called from inside build_url, based on details learned from a moniker hook (only if a hook exists to hint how to make the requested link SEO friendly).
 *
 * @param  array $url_parts The URL component map (must contain 'page', 'type', and 'id' if this function is to do anything)
 * @param  ID_TEXT $zone The URL zone name (only used for Comcode Page URL monikers)
 * @param  boolean $search_redirects Whether to consider that the page may have been redirected. We'll generally set this to false when linking, as we know that redirects will be considered elsewhere in the stack anyway
 * @return ?string The moniker ID (null: could not find)
 */

function find_id_moniker(array $url_parts, string $zone, bool $search_redirects = true) : ?string