Function __global->post_param_image
Definitions
sources/images2.php
- An image has been passed through by POST, either as a file (a new upload), a URL, a reference to an existing theme image, or as a filedump reference.Used with form_input_upload_multi_source.Get the image URL from the POST data.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $name | ID_TEXT | No | No | image | N/A | N/A | Form field prefix (input type suffixes will be added automatically) |
| $upload_to | ?PATH | No | No | Null | N/A | N/A | Where to upload to (null: the correct place for $theme_image_type) |
| $theme_image_type | ?ID_TEXT | No | No | Null | N/A | N/A | The directory of theme images to store under (null: do not support theme images) |
| $required | boolean | No | No | True | N/A | N/A | Whether an image is required |
| $is_edit | boolean | No | No | False | N/A | N/A | Whether this is an edit operation |
| &$filename | ?string | Yes | No | Null | N/A | N/A | Pass the filename back by reference (null: do not pass) |
| &$thumb_url | ?string | Yes | No | Null | N/A | N/A | Pass the thumbnail back by reference (null: do not pass & do not collect a thumbnail) |
Returns
- The URL (either to an independent upload, or the theme image, or a filedump URL) (null: leave alone, when doing an edit operation)
- Type: ?URLPATH
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* An image has been passed through by POST, either as a file (a new upload), a URL, a reference to an existing theme image, or as a filedump reference.Used with form_input_upload_multi_source.Get the image URL from the POST data.
*
* @param ID_TEXT $name Form field prefix (input type suffixes will be added automatically)
* @param ?PATH $upload_to Where to upload to (null: the correct place for $theme_image_type)
* @param ?ID_TEXT $theme_image_type The directory of theme images to store under (null: do not support theme images)
* @param boolean $required Whether an image is required
* @param boolean $is_edit Whether this is an edit operation
* @param ?string $filename Pass the filename back by reference (null: do not pass)
* @param ?string $thumb_url Pass the thumbnail back by reference (null: do not pass & do not collect a thumbnail)
* @return ?URLPATH The URL (either to an independent upload, or the theme image, or a filedump URL) (null: leave alone, when doing an edit operation)
*/
function post_param_image(string $name = 'image', ?string $upload_to = null, ?string $theme_image_type = null, bool $required = true, bool $is_edit = false, ?string &$filename = null, ?string &$thumb_url = null) : ?string
* An image has been passed through by POST, either as a file (a new upload), a URL, a reference to an existing theme image, or as a filedump reference.Used with form_input_upload_multi_source.Get the image URL from the POST data.
*
* @param ID_TEXT $name Form field prefix (input type suffixes will be added automatically)
* @param ?PATH $upload_to Where to upload to (null: the correct place for $theme_image_type)
* @param ?ID_TEXT $theme_image_type The directory of theme images to store under (null: do not support theme images)
* @param boolean $required Whether an image is required
* @param boolean $is_edit Whether this is an edit operation
* @param ?string $filename Pass the filename back by reference (null: do not pass)
* @param ?string $thumb_url Pass the thumbnail back by reference (null: do not pass & do not collect a thumbnail)
* @return ?URLPATH The URL (either to an independent upload, or the theme image, or a filedump URL) (null: leave alone, when doing an edit operation)
*/
function post_param_image(string $name = 'image', ?string $upload_to = null, ?string $theme_image_type = null, bool $required = true, bool $is_edit = false, ?string &$filename = null, ?string &$thumb_url = null) : ?string

