From c8ab57939a9fe08243b9a3a5d6782df70256de46 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 12 Aug 2024 15:51:56 +0200 Subject: [PATCH] Document migration to `CategoryAddFormBuilderForm` Closes #456 --- docs/migration/wsc60/php.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/migration/wsc60/php.md b/docs/migration/wsc60/php.md index f6d9ced2..2fc6731e 100644 --- a/docs/migration/wsc60/php.md +++ b/docs/migration/wsc60/php.md @@ -122,3 +122,27 @@ return WCF::getTPL()->fetch('templateName', 'application', [ ``` See [WoltLab/WCF#5910](https://github.com/WoltLab/WCF/issues/5910) for more details. + +## Creating Categories Based on the Formbuilder + +A new basic implementation based on the FormBuilder for creating and editing categories has been introduced. +The old implementation (`AbstractCategoryAddForm`) remains for backward compatibility reasons, but has been deprecated. + +Usage (form for creating categories): + +```php +class FooBarCategoryAddForm extends CategoryAddFormBuilderForm { + public string $objectTypeName = 'foo.bar.category'; +} +``` + +Usage (form for editing categories): + +```php +class FooBarCategoryEditForm extends FooBarCategoryAddForm { + public $formAction = 'edit'; +} +``` + +See [WoltLab/WCF#5657](https://github.com/WoltLab/WCF/pull/5657 +) for more details. -- 2.20.1