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
$cObj
protected
ContentObjectRenderer|null
$cObj
= null
$markerTemplateService read-only
protected
MarkerBasedTemplateService
$markerTemplateService
$pageRenderer
protected
PageRenderer|null
$pageRenderer
= null
$request
Always set via setRequest() by ContentObjectFactory after instantiation
protected
ServerRequestInterface
$request
Methods
__construct()
public
__construct(MarkerBasedTemplateService $markerTemplateService) : mixed
Parameters
- $markerTemplateService : MarkerBasedTemplateService
getContentObjectRenderer()
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.
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) : 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
Tags
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.
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