Extbase controllers

In order to increase compatibility with standard extbase plugins, the extension supports the rendering of extbase controller actions. For this purpose, a compatibility layer was introduced, with which own DataProcessors can be triggered using the HandlebarsViewResolver.

Configuration

Tag each DataProcessor with handlebars.compatibility_layer within your Services.yaml file and provide additional information about the target extbase controller and actions supported by it.

# Configuration/Services.yaml

services:
  Vendor\Extension\DataProcessing\MyProcessor:
    tags:
      - name: handlebars.processor
      - name: handlebars.compatibility_layer
        controller: 'Vendor\Extension\Controller\MyController'
        actions: 'dummy'

The action configuration can be either empty (= NULL) or set to a comma-separated list of action names that are supported by the configured DataProcessor. If you leave it empty, the DataProcessor is used for all controller actions.

Important

Only DataProcessors that are additionally tagged with handlebars.processor are respected as component for additional compatibility layers.

Usage

Once the HandlebarsViewResolver is triggered to render a specific "view", it creates an array of information and passes it to the configured DataProcessor. You can then take further steps based on the provided configuration.

When accessing the $configuration property inside your DataProcessor, you should see the following properties:

$configuration = [
    'extbaseViewConfiguration' => [
        'controller' => '<controller class>',
        'action' => '<controller action>',
        'request' => '<original extbase request>',
        'variables' => '<template variables>',
    ],
];