Controllers API
Controllers handle HTTP requests in the backend and bridge TypoScript to the service architecture.
Table of contents
Changed in version 13.1.5
The legacy
Image and
Image were removed
and replaced with
Image using the new service architecture.
See Services API for the new service-based approach.
SelectImageController
- class SelectImageController
-
- Fully qualified name
-
\Netresearch\
Rte CKEditor Image\ Controller\ Select Image Controller
Main controller for image selection and processing in the CKEditor context.
- Backend Route
-
rteckeditorimage_→wizard_ select_ image /rte/wizard/ selectimage
Methods
mainAction()
- mainAction ( ServerRequestInterface $request) : ResponseInterface
-
Entry point for the image browser/selection interface.
- param ServerRequestInterface $request
-
PSR-7 server request with query parameters.
- returntype
-
ResponseInterface
- Returns
-
PSR-7 response with file browser HTML.
Query parameters:
mode: Browser mode (default:filefrom route configuration).bparams: Browser parameters passed to file browser.
Usage example:
// Called from CKEditor plugin
const contentUrl = routeUrl + '&contentsLanguage=en&editorId=123&bparams=' + bparams.join('|');
infoAction()
- infoAction ( ServerRequestInterface $request) : ResponseInterface
-
Returns JSON with image information and processed variants.
- param ServerRequestInterface $request
-
Server request with file identification and processing parameters.
- returntype
-
ResponseInterface
- Returns
-
JSON response with image data.
Query parameters:
file: FAL file UID.Id table: Database table (usuallysys_).file P: Desired width (optional).[width] P: Desired height (optional).[height] action: Action type (info).
Response structure:
{
"uid": 123,
"url": "/fileadmin/user_upload/image.jpg",
"width": 1920,
"height": 1080,
"title": "Image title",
"alt": "Alternative text",
"processed": {
"url": "/fileadmin/_processed_/image_hash.jpg",
"width": 800,
"height": 450
},
"lang": {
"override": "Override %s",
"overrideNoDefault": "Override (no default)",
"zoom": "Zoom",
"cssClass": "CSS Class"
}
}
ImageRenderingAdapter
New in version 13.1.5
Replaces the legacy
Image and
Image.
- class ImageRenderingAdapter
-
- Fully qualified name
-
\Netresearch\
Rte CKEditor Image\ Controller\ Image Rendering Adapter
TypoScript adapter bridging
preto the modern service architecture.User Func
The adapter serves as a thin layer between TypoScript's pre interface and the
service-based architecture. It delegates actual processing to:
- ImageAttributeParser - HTML parsing.
- ImageResolverService - Business logic and security.
- ImageRenderingService - Fluid template rendering.
Methods
renderImageAttributes()
- renderImageAttributes ( $content, $conf)
-
Processes
<img>tags in RTE content using the service pipeline.- param string $content
-
Current HTML content (single
<img>tag). - param array $conf
-
TypoScript configuration.
- returntype
-
string
- Returns
-
Processed HTML with updated image URL and attributes.
Processing pipeline:
Imageextracts data attributes from HTML.Attribute Parser Imageresolves FAL file, applies security checks, processes image.Resolver Service Imagerenders via Fluid template.Rendering Service
TypoScript integration:
lib.parseFunc_RTE {
tags.img = TEXT
tags.img {
current = 1
preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageRenderingAdapter->renderImageAttributes
}
}
renderLinkedImageAttributes()
- renderLinkedImageAttributes ( $content, $conf)
-
Processes
<img>tags within<a>tags (linked images).- param string $content
-
HTML content (complete
<a>tag with nested<img>). - param array $conf
-
TypoScript configuration.
- returntype
-
string
- Returns
-
Processed HTML with both link and image correctly rendered.
TypoScript integration:
lib.parseFunc_RTE {
tags.a = TEXT
tags.a {
current = 1
preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageRenderingAdapter->renderLinkedImageAttributes
}
}
Service configuration
All controllers are configured in Configuration/:
Netresearch\RteCKEditorImage\Controller\SelectImageController:
tags: ['backend.controller']
Netresearch\RteCKEditorImage\Controller\ImageRenderingAdapter:
public: true
Controllers use constructor injection for dependencies.
Migration from legacy controllers
Changed in version 13.1.5
If you were extending the legacy controllers via XCLASS, migrate to:
- Template overrides (recommended): Override Fluid templates in your site package. See Template Overrides.
- Service decoration: Decorate
ImageorResolver Service Image. See Services API.Rendering Service
The TypoScript interface remains 100% backward compatible - no changes required for standard usage.