Controllers API 

Controllers handle HTTP requests in the backend and bridge TypoScript to the service architecture.

Changed in version 13.1.5

The legacy ImageRenderingController and ImageLinkRenderingController were removed and replaced with ImageRenderingAdapter using the new service architecture. See Services API for the new service-based approach.

SelectImageController 

class SelectImageController
Fully qualified name
\Netresearch\RteCKEditorImage\Controller\SelectImageController

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: file from route configuration).
  • bparams: Browser parameters passed to file browser.
  • action (POST body, else query string): info dispatches to infoAction() , linkBrowser or linkbrowser dispatches to linkBrowserAction() . Without action, the file browser is shown.

Usage example:

CKEditor plugin integration
// Called from CKEditor plugin
const contentUrl = routeUrl + '&contentsLanguage=en&editorId=123&bparams=' + bparams.join('|');
Copied!

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:

  • fileId: FAL file UID.
  • table: Database table (usually sys_file).
  • P[width]: Desired width (optional).
  • P[height]: Desired height (optional).
  • action: Action type (info).

Response structure:

Image info API response
{
  "uid": 123,
  "url": "/fileadmin/user_upload/image.jpg",
  "width": 1920,
  "height": 1080,
  "title": "Image title",
  "alt": "Alternative text",
  "extension": "jpg",
  "storageDriver": "Local",
  "processed": {
    "url": "/fileadmin/_processed_/image_hash.jpg",
    "width": 800,
    "height": 450
  },
  "lang": {
    "override": "Override %s",
    "overrideNoDefault": "Override (no default)",
    "zoom": "Zoom",
    "cssClass": "CSS Class"
  }
}
Copied!

linkBrowserAction() 

linkBrowserAction(ServerRequestInterface $request): ResponseInterface

Returns JSON with the URL of the TYPO3 link browser (route wizard_link) for linking an image.

param ServerRequestInterface $request

Server request.

returntype

ResponseInterface

AJAX Route

rteckeditorimage_link_browser → /rte/image/linkbrowser

Returns

JSON response {"url": "..."}, or {"error": "..."} with status 500.

Query parameters:

  • P[pid] (or pid): Page ID for the link browser context.
  • currentValue: Current link value.

The link type and field restrictions (allowedTypes, blindLinkOptions, allowedOptions, blindLinkFields) are read from the active RTE preset.

ImageRenderingAdapter 

New in version 13.1.5

Replaces the legacy ImageRenderingController and ImageLinkRenderingController .

class ImageRenderingAdapter
Fully qualified name
\Netresearch\RteCKEditorImage\Controller\ImageRenderingAdapter

TypoScript adapter bridging preUserFunc to the modern service architecture.

The adapter serves as a thin layer between TypoScript's preUserFunc interface and the service-based architecture. It delegates actual processing to:

Methods 

renderImageAttributes() 

renderImageAttributes($content, $conf, $request)

Processes <img> tags in RTE content using the service pipeline.

param string $content

Current HTML content (single <img> tag).

param array $conf

TypoScript configuration.

param ServerRequestInterface $request

Current request.

returntype

string

Returns

Processed HTML with updated image URL and attributes.

Processing pipeline:

  1. ImageAttributeParser extracts data attributes from HTML.
  2. ImageResolverService resolves FAL file, applies security checks, processes image.
  3. ImageRenderingService renders via Fluid template.

TypoScript integration:

Image tag processing configuration
lib.parseFunc_RTE {
    tags.img = TEXT
    tags.img {
        current = 1
        preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageRenderingAdapter->renderImageAttributes
    }
}
Copied!

prepareInlineLinkContent() 

New in version 13.7.0

prepareInlineLinkContent($content, $conf, $request)

Pre-processes the content of an <a> tag before the standard typolink builds the link. It only strips nested link wrappers from historical double-wrapped content. t3:// resolution, targets and the original attributes are handled by typolink .

param string|null $content

Inner content of the <a> tag.

param array $conf

TypoScript configuration.

param ServerRequestInterface $request

Current request.

returntype

string

Returns

Pre-processed content for typolink to wrap.

TypoScript integration:

Link processing configuration
lib.parseFunc_RTE {
    tags.a = TEXT
    tags.a {
        current = 1
        typolink {
            parameter.data = parameters:href
            title.data = parameters:title
            ATagParams.data = parameters:allParams
            target.ifEmpty.data = parameters:target
        }
    }
    tags.a.preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageRenderingAdapter->prepareInlineLinkContent
}
Copied!

renderFigure() 

renderFigure($content, $conf, $request)

Renders figure-wrapped images with caption support. This is the default handler for lib.parseFunc_RTE.externalBlocks.figure.stdWrap.preUserFunc . It handles <figure><img><figcaption> and linked images <figure><a><img></a><figcaption> .

param string|null $content

Complete figure HTML from externalBlocks ; if empty, the current value of the ContentObjectRenderer is used.

param array $conf

TypoScript configuration.

param ServerRequestInterface $request

Current request.

returntype

string

Returns

Rendered HTML.

Service configuration 

All controllers are configured in Configuration/Services.yaml:

EXT:rte_ckeditor_image/Configuration/Services.yaml
Netresearch\RteCKEditorImage\Controller\SelectImageController:
  tags: ['backend.controller']

Netresearch\RteCKEditorImage\Controller\ImageRenderingAdapter:
  public: true
Copied!

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:

  1. Template overrides (recommended): Override Fluid templates in your site package. See Template Overrides.
  2. Service decoration: Decorate ImageResolverService or ImageRenderingService with a subclass of the decorated class. See Services API.

The TypoScript interface remains 100% backward compatible - no changes required for standard usage.