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
$cObj
protected
ContentObjectRenderer
$cObj
$pageRenderer
protected
PageRenderer
$pageRenderer
$request
protected
ServerRequestInterface|null
$request
= null
Methods
__construct()
Default constructor.
public
__construct(ContentObjectRenderer $cObj) : mixed
Parameters
- $cObj : ContentObjectRenderer
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<string|int, mixed> $conf[, bool $longDesc = true ]) : string
From the $conf array it implements the properties "altText", "titleText" and "longdescURL"
Parameters
- $conf : array<string|int, mixed>
-
TypoScript configuration properties
- $longDesc : bool = true
-
If set, the longdesc attribute will be generated - must only be used for img elements!
Tags
Return values
string —Parameter string containing alt and title parameters (if any)
getContentObjectRenderer()
Getter for current ContentObjectRenderer
public
getContentObjectRenderer() : ContentObjectRenderer
Return values
ContentObjectRendererrender()
Rendering the cObject, IMAGE
public
render([array<string|int, mixed> $conf = [] ]) : string
Parameters
- $conf : array<string|int, mixed> = []
-
Array of TypoScript properties
Return values
string —Output
setContentObjectRenderer()
public
setContentObjectRenderer(ContentObjectRenderer $cObj) : void
Parameters
- $cObj : ContentObjectRenderer
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<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 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.
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<string|int, mixed> $conf, string $file) : string
Parameters
- $layoutKey : string
-
rendering key
- $conf : array<string|int, mixed>
-
TypoScript configuration properties
- $file : string
Tags
Return values
stringgetImageTagTemplate()
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
stringgetPageRenderer()
protected
getPageRenderer() : PageRenderer
Return values
PageRenderergetPageRepository()
protected
getPageRepository() : PageRepository
Return values
PageRepositorygetTypoScriptFrontendController()
protected
getTypoScriptFrontendController() : TypoScriptFrontendController
Return values
TypoScriptFrontendControllerhasTypoScriptFrontendController()
protected
hasTypoScriptFrontendController() : bool
Return values
boollinkWrap()
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