---
title: "Feature: #106945 - Allow usage of Symfony validators in Extbase"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-106945-1750757664"
source: "Changelog/14.0/Feature-106945-AllowUsageOfSymfonyValidatorsInExtbase.rst"
typo3-version: "14.0"
typo3-major: 14
type: "feature"
issue: 106945
forge: "https://forge.typo3.org/issues/106945"
tags: ["Frontend", "ext:extbase"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Feature: #106945 - Allow usage of Symfony validators in Extbase {#feature-106945-1750757664}

See [forge#106945](https://forge.typo3.org/issues/106945)

## Description {#description}

Extbase models and controllers now support the use of
[Symfony Validators](https://symfony.com/doc/current/components/validator.html).
Validators are based on Symfony *Constraints*, which can be added as attributes
to domain model properties and controller methods.

Once a constraint attribute is detected while reflecting properties or methods,
it is decorated by the new
`ConstraintDecoratingValidator`
class, which is compatible with Extbase's
`ValidatorInterface`.

Decorated constraints may include localizable messages. If a message contains
valid `LLL:` syntax, the label will be translated automatically. The decorating
validator also handles message parameters by converting named parameters such as
`{{ value }}` into `sprintf`-compatible placeholders like `%1$s`.

> [!IMPORTANT]
> Most available Symfony constraints, such as `#[NotBlank]` and
> `#[Regex]`, can be used. However, more complex constraints such as
> `#[File]` or `#[Image]` are not yet compatible with the current
> Extbase implementation, as they are closely tied to the Symfony framework.
> Compatibility for those constraints may be added in the future.

### Example {#example}

**EXT:my_extension/Classes/Domain/Model/MyModel.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Domain\Model;

use Symfony\Component\Validator\Constraints as Assert;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;

class MyModel extends AbstractEntity
{
    #[Assert\WordCount(max: 200, maxMessage: 'Biography must not exceed 200 words.')]
    protected string $biography = '';

    #[Assert\CssColor(message: 'LLL:EXT:my_extension/Resources/Private/Language/locallang.xlf:validator.avatarColor.error')]
    protected string $avatarColor = '';

    #[Assert\Iban]
    protected string $iban = '';

    public function getBiography(): string
    {
        return $this->biography;
    }

    public function setBiography(string $biography): void
    {
        $this->biography = $biography;
    }

    public function getAvatarColor(): string
    {
        return $this->avatarColor;
    }

    public function setAvatarColor(string $avatarColor): void
    {
        $this->avatarColor = $avatarColor;
    }

    public function getIban(): string
    {
        return $this->iban;
    }

    public function setIban(string $iban): void
    {
        $this->iban = $iban;
    }
}
```

## Impact {#impact}

A wide range of Symfony validators can now be used directly in Extbase.
This provides a more flexible and standardized validation workflow without the
need to implement custom validators, as Symfony already ships with a large
number of predefined constraints.
