Function __global->get_translated_tempcode

Definitions

sources/lang.php

  • This function is an offshoot of get_translated_text, it instead returns parsed Comcode that is linked to the specified content language string ID.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$table ID_TEXT No No required parameter N/A N/A The table name
$row array No No required parameter N/A N/A The table row. Must not have aspects of other tables in it (i.e. joins). Pre-filter using 'db_map_restrict' if required
$field_name ID_TEXT No No required parameter N/A N/A The field name
$db ?object No No Null N/A N/A The database connector to use (null: standard site connector)
$lang ?LANGUAGE_NAME No No Null N/A N/A The language (null: uses the current language)
$force boolean No No False N/A N/A Whether to force it to the specified language
$as_admin boolean No No False N/A N/A Whether to force as_admin, even if the content language string isn't stored against an admin (designed for Comcode page caching)
$clear_away_from_cache boolean No No False N/A N/A Whether to remove from the Tempcode cache when we're done, for performance reasons (normally don't bother with this, but some code knows it won't be needed again -- esp Comcode cache layer -- and saves RAM by removing it)
$ignore_browser_decaching boolean No No False N/A N/A If we have just re-populated so will not decache

Returns

  • The parsed Comcode (null: the text couldn't be looked up)
  • Type: ?Tempcode
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * This function is an offshoot of get_translated_text, it instead returns parsed Comcode that is linked to the specified content language string ID.
 *
 * @param  ID_TEXT $table The table name
 * @param  array $row The table row. Must not have aspects of other tables in it (i.e. joins). Pre-filter using 'db_map_restrict' if required
 * @param  ID_TEXT $field_name The field name
 * @param  ?object $db The database connector to use (null: standard site connector)
 * @param  ?LANGUAGE_NAME $lang The language (null: uses the current language)
 * @param  boolean $force Whether to force it to the specified language
 * @param  boolean $as_admin Whether to force as_admin, even if the content language string isn't stored against an admin (designed for Comcode page caching)
 * @param  boolean $clear_away_from_cache Whether to remove from the Tempcode cache when we're done, for performance reasons (normally don't bother with this, but some code knows it won't be needed again -- esp Comcode cache layer -- and saves RAM by removing it)
 * @param  boolean $ignore_browser_decaching If we have just re-populated so will not decache
 * @return ?Tempcode The parsed Comcode (null: the text couldn't be looked up)
 */

function get_translated_tempcode(string $table, array $row, string $field_name, ?object $db = null, ?string $lang = null, bool $force = false, bool $as_admin = false, bool $clear_away_from_cache = false, bool $ignore_browser_decaching = false) : ?object