---
title: "Closure finisher"
manual: "Form"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/typo3/cms-form:concepts-finishers-closurefinisher@13.4"
source: "I/Concepts/Finishers/ReadyToUseFinishers/ClosureFinisher/Index.rst"
rendered: "2026-10-03T08:24:23+00:00"
---

# Closure finisher {#concepts-finishers-closurefinisher}

The "Closure finisher" can only be used within forms that are created
programmatically. It allows you to execute your own finisher code without
implementing/ declaring a finisher.

**Table of contents**

-   [Options of the closure finisher](https://docs.typo3.org/permalink/typo3/cms-form:options-of-the-closure-finisher@13.4)
-   [Using the closure finisher programmatically](https://docs.typo3.org/permalink/typo3/cms-form:using-the-closure-finisher-programmatically@13.4)

> [!IMPORTANT]
> Finishers are executed in the order defined in your form definition.
>
> See [Finisher execution order](https://docs.typo3.org/permalink/typo3/cms-form:concepts-finishers-execution-order@13.4).

## Options of the closure finisher {#apireference-finisheroptions-closurefinisher-options}

-   **closure**

    -   *Type:* `?Closure`
    -   *Required:* true
    -   *Default:* `null`

    The name of the field as shown in the form.

## Using the closure finisher programmatically {#apireference-finisheroptions-closurefinisher}

This finisher can only be used in programmatically-created forms. It makes it
possible to execute one's own finisher code without having to implement/
declare this finisher.

Usage through code:

```php
<?php

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Form\Domain\Finishers\ClosureFinisher;
use TYPO3\CMS\Form\Domain\Model\FormDefinition;

class SomeClass
{
    private function addClosureFinisher(FormDefinition $formDefinition)
    {

        $closureFinisher = GeneralUtility::makeInstance(ClosureFinisher::class);
        $closureFinisher->setOption('closure', function ($finisherContext)
        {
            $formRuntime = $finisherContext->getFormRuntime();
            // ...
        });
        $formDefinition->addFinisher($closureFinisher);
    }
}

```

This finisher is implemented in `\TYPO3\CMS\Form\Domain\Finishers\ClosureFinisher`.
