ImageContentObject extends AbstractContentObject

Contains IMAGE class object.

Table of Contents

Properties

$cObj  : ContentObjectRenderer|null
$markerTemplateService  : MarkerBasedTemplateService
$pageRenderer  : PageRenderer|null
$request  : ServerRequestInterface
Always set via setRequest() by ContentObjectFactory after instantiation

Methods

__construct()  : mixed
getContentObjectRenderer()  : ContentObjectRenderer
render()  : string
Rendering the cObject, IMAGE
setContentObjectRenderer()  : void
setRequest()  : void
cImage()  : string
Returns a <img> tag with the image file defined by $file and processed according to the properties in the TypoScript array.
getAltParam()  : string
An abstraction method which creates an alt or title parameter for an HTML img, applet, area or input element and the FILE content element.
getImageSourceCollection()  : string
Render alternate sources for the image tag. If no source collection is given an empty string is returned.
getImageTagTemplate()  : string
Returns the html-template for rendering the image-Tag if no template is defined via typoscript the default <img> tag template is returned
getPageRenderer()  : PageRenderer
getPageRepository()  : PageRepository
getTypoScriptFrontendController()  : TypoScriptFrontendController
hasTypoScriptFrontendController()  : bool
linkWrap()  : string
Wraps the input string by the $wrap value and implements the "linkWrap" data type as well.

Properties

$request

Always set via setRequest() by ContentObjectFactory after instantiation

protected ServerRequestInterface $request

Methods

render()

Rendering the cObject, IMAGE

public render([array<string|int, mixed>|mixed $conf = [] ]) : string
Parameters
$conf : array<string|int, mixed>|mixed = []

Array of TypoScript properties

Return values
string

Output

setRequest()

public setRequest(ServerRequestInterface $request) : void
Parameters
$request : ServerRequestInterface

cImage()

Returns a <img> tag with the image file defined by $file and processed according to the properties in the TypoScript array.

protected cImage(string|File|FileReference|null $file, array<string|int, mixed> $conf) : string

Mostly this function is a sub-function to the IMAGE function which renders the IMAGE cObject in TypoScript.

Parameters
$file : string|File|FileReference|null

File TypoScript resource

$conf : array<string|int, mixed>

TypoScript configuration properties

Return values
string

HTML tag, (possibly wrapped in links and other HTML) if any image found.

getAltParam()

An abstraction method which creates an alt or title parameter for an HTML img, applet, area or input element and the FILE content element.

protected getAltParam(array<string|int, mixed> $conf) : string

From the $conf array it implements the properties "altText" and "titleText"

Parameters
$conf : array<string|int, mixed>

TypoScript configuration properties

Return values
string

Parameter string containing alt and title parameters (if any)

getImageSourceCollection()

Render alternate sources for the image tag. If no source collection is given an empty string is returned.

protected getImageSourceCollection(string $layoutKey, array<string|int, mixed> $conf, string|File|FileReference|null $file) : string
Parameters
$layoutKey : string

rendering key

$conf : array<string|int, mixed>

TypoScript configuration properties

$file : string|File|FileReference|null
Return values
string

getImageTagTemplate()

Returns the html-template for rendering the image-Tag if no template is defined via typoscript the default <img> tag template is returned

protected getImageTagTemplate(string $layoutKey, array<string|int, mixed> $conf) : string
Parameters
$layoutKey : string

rendering key

$conf : array<string|int, mixed>

TypoScript configuration properties

Return values
string

hasTypoScriptFrontendController()

protected hasTypoScriptFrontendController() : bool
Return values
bool

linkWrap()

Wraps the input string by the $wrap value and implements the "linkWrap" data type as well.

protected linkWrap(string $content, string $wrap) : string

The "linkWrap" data type means that this function will find any integer encapsulated in } (curly braces) in the first wrap part and substitute it with the corresponding page uid from the rootline where the found integer is pointing to the key in the rootline.

Parameters
$content : string

Input string

$wrap : string

A string where the first two parts separated by "|" (vertical line) will be wrapped around the input string

Return values
string

        
On this page

Search results