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.

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",
  "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!

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)

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:

  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!

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:

Linked image processing configuration
lib.parseFunc_RTE {
    tags.a = TEXT
    tags.a {
        current = 1
        preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageRenderingAdapter->renderLinkedImageAttributes
    }
}
Copied!

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. See Services API.

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