Function __global->post_param_theme_img_code

Definitions

sources/themes2.php

  • A theme image has been passed through by POST, either as a file (a new theme image), or as a reference to an existing one. Get the image code from the POST data.Note that post_param_image is a more comprehensive function, if you accept other types of inputs too.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$type ID_TEXT No No required parameter N/A N/A The type of theme image
$required boolean No No False N/A N/A Whether a code is required
$field_file ID_TEXT No No file N/A N/A Form field for uploading
$field_choose ID_TEXT No No theme_img_code N/A N/A Form field for choosing
$db ?object No No Null N/A N/A Database connector (null: site database)
$upload_to ?PATH No No Null N/A N/A Where to upload the theme images to (null: something sensible)

Returns

  • The (possibly randomised) theme image code
  • Type: ID_TEXT
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * A theme image has been passed through by POST, either as a file (a new theme image), or as a reference to an existing one. Get the image code from the POST data.Note that post_param_image is a more comprehensive function, if you accept other types of inputs too.
 *
 * @param  ID_TEXT $type The type of theme image
 * @param  boolean $required Whether a code is required
 * @param  ID_TEXT $field_file Form field for uploading
 * @param  ID_TEXT $field_choose Form field for choosing
 * @param  ?object $db Database connector (null: site database)
 * @param  ?PATH $upload_to Where to upload the theme images to (null: something sensible)
 * @return ID_TEXT The (possibly randomised) theme image code
 */

function post_param_theme_img_code(string $type, bool $required = false, string $field_file = 'file', string $field_choose = 'theme_img_code', ?object $db = null, ?string $upload_to = null) : string