---
title: "Renderer"
manual: "Handlebars"
version: "main"
permalink: "https://docs.typo3.org/permalink/cpsit/typo3-handlebars:developer-corner-renderer@main"
source: "DeveloperCorner/Renderer.rst"
rendered: "2026-09-29T09:05:57+00:00"
---

# Renderer {#developer-corner-renderer}

Implement the [\\CPSIT\\Typo3Handlebars\\Renderer\\Renderer](https://docs.typo3.org/permalink/cpsit/typo3-handlebars:cpsit-typo3handlebars-renderer-renderer@main)
interface to replace the entire rendering stack — for example to use a
different template engine, add a pre-render transformation, or wrap the
compiled output. The default implementation is
`\CPSIT\Typo3Handlebars\Renderer\HandlebarsRenderer`.

-   **interface Renderer**

    -   *Fully qualified name:* `\CPSIT\Typo3Handlebars\Renderer\Renderer`

    -   **renderTemplate(RenderingContext $context)**

        Compile and render a template. The `RenderingContext` carries the
        template path or inline source, the current variable set, and the PSR-7
        request.

        -   *param RenderingContext $context:* The current rendering context.
        -   *returntype:* string

    -   **renderPartial(RenderingContext $context)**

        Compile and render a partial.

        -   *param RenderingContext $context:* The current rendering context.
        -   *returntype:* string

## Wiring the implementation {#developer-corner-renderer-wire}

Register the custom renderer as the implementation of the
`Renderer` interface in your extension's `Services.yaml`:

**Configuration/Services.yaml**

```yaml
services:
  CPSIT\Typo3Handlebars\Renderer\Renderer:
    alias: Vendor\Extension\Renderer\MyRenderer
```
