0 follower

Final Class Yiisoft\Validator\PropertyTranslator\TranslatorPropertyTranslator

InheritanceYiisoft\Validator\PropertyTranslator\TranslatorPropertyTranslator
ImplementsYiisoft\Validator\PropertyTranslatorInterface

A property translator that uses TranslatorInterface.

Method Details

Hide inherited methods

__construct() public method

public __construct( \Yiisoft\Translator\TranslatorInterface $translator ): mixed
$translator \Yiisoft\Translator\TranslatorInterface

Translator to use.

                public function __construct(
    private readonly TranslatorInterface $translator,
) {}

            
translate() public method

public translate( string $property ): string
$property string

                public function translate(string $property): string
{
    return $this->translator->translate($property);
}