ImageContentObject

class \TYPO3\CMS\Frontend\ContentObject\ImageContentObject

Extends
AbstractContentObject

Contains IMAGE class object.

Table of Contents

Properties

$cObj  : ContentObjectRenderer
$pageRenderer  : PageRenderer
$request  : ServerRequestInterface|null

Methods

__construct()  : mixed
Default constructor.
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.
getContentObjectRenderer()  : ContentObjectRenderer
Getter for current 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.
getBorderAttr()  : string
Returns the 'border' attribute for an <img> tag only if the doctype is not xhtml_strict, xhtml_11 or html5 or if the config parameter 'disableImgBorderAttr' is not set.
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

protected ServerRequestInterface|null $request = null

Methods

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.

public getAltParam(array $conf[, bool $longDesc = true ]) : string

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

Parameters

$conf : array

TypoScript configuration properties

$longDesc : bool = true

If set, the longdesc attribute will be generated - must only be used for img elements!

Tags

see
cImage()

Return values

string —

Parameter string containing alt and title parameters (if any)

render()

Rendering the cObject, IMAGE

public render([array $conf = [] ]) : string

Parameters

$conf : array = []

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, array $conf) : string

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

Parameters

$file : string

File TypoScript resource

$conf : array

TypoScript configuration properties

Return values

string —

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

getBorderAttr()

Returns the 'border' attribute for an <img> tag only if the doctype is not xhtml_strict, xhtml_11 or html5 or if the config parameter 'disableImgBorderAttr' is not set.

protected getBorderAttr(string $borderAttr) : string

Parameters

$borderAttr : string

The border attribute

Return values

string —

The border attribute

getImageSourceCollection()

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

protected getImageSourceCollection(string $layoutKey, array $conf, string $file) : string

Parameters

$layoutKey : string

rendering key

$conf : array

TypoScript configuration properties

$file : string

Tags

throws
UnexpectedValueException

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 $conf) : string

Parameters

$layoutKey : string

rendering key

$conf : array

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. See link below.

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