Function __global->do_code_box

Definitions

sources/comcode_renderer.php

  • Render a code box.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$type string No No required parameter N/A N/A The data type (e.g. file extension) we are rendering.
$embed Tempcode No No required parameter N/A N/A Contents (code) to render
$numbers boolean No No True N/A N/A Whether to show line numbers
$in_semihtml boolean No No False N/A N/A Whether what we have came from inside a semihtml tag
$is_all_semihtml boolean No No False N/A N/A Whether what we have came from semihtml mode

Returns

  • A pair: The Tempcode for the code box, and the title of the box
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Render a code box.
 *
 * @param  string $type The data type (e.g. file extension) we are rendering.
 * @param  Tempcode $embed Contents (code) to render
 * @param  boolean $numbers Whether to show line numbers
 * @param  boolean $in_semihtml Whether what we have came from inside a semihtml tag
 * @param  boolean $is_all_semihtml Whether what we have came from semihtml mode
 * @return array A pair: The Tempcode for the code box, and the title of the box
 */

function do_code_box(string $type, object $embed, bool $numbers = true, bool $in_semihtml = false, bool $is_all_semihtml = false) : array