TYPO3 v15 dev-main snapshot ()

This commit is contained in:
2026-08-10 22:31:24 +02:00
commit aad9daaefd
1506 changed files with 94005 additions and 0 deletions
@@ -0,0 +1,43 @@
.. include:: /Includes.rst.txt
.. _concepts-finishers-closurefinisher:
================
Closure finisher
================
The "Closure finisher" can only be used in programmatically-created forms. It allows
you to execute your own finisher code without implementing/ declaring a finisher.
.. contents:: Table of contents
.. include:: /Includes/_NoteFinisher.rst
.. _apireference-finisheroptions-closurefinisher-options:
Closure finisher option
=======================
.. _apireference-finisheroptions-closurefinisher-options-closure:
.. confval:: closure
:name: closurefinisher-closure
:required: true
:type: `?\Closure`
:default: `null`
The name of the field as shown in the form.
.. _apireference-finisheroptions-closurefinisher:
Using the closure finisher programmatically
===========================================
This finisher can only be used in programmatically-created forms. It allows
you to execute your own finisher code without implementing/ declaring a finisher.
Code example:
.. literalinclude:: _codesnippets/_finisher.php.inc
:language: php
This finisher is implemented in :php:`TYPO3\CMS\Form\Domain\Finishers\ClosureFinisher`.
@@ -0,0 +1,20 @@
<?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);
}
}