Function __global->get_self_url_easy

Definitions

sources/urls.php

  • Get a well formed URL equivalent to the current URL. Reads direct from the environment and does no clever mapping at all. This function should rarely be used.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$script_name_if_cli boolean No No False N/A N/A Return the script name instead of a URL, if running on the CLI. If this is set to false it will return the base URL instead.

Returns

  • The URL
  • Type: URLPATH
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get a well formed URL equivalent to the current URL. Reads direct from the environment and does no clever mapping at all. This function should rarely be used.
 *
 * @param  boolean $script_name_if_cli Return the script name instead of a URL, if running on the CLI. If this is set to false it will return the base URL instead.
 * @return URLPATH The URL
 */

function get_self_url_easy(bool $script_name_if_cli = false) : string