0 follower

Final Class Yiisoft\Validator\PropertyTranslator\TranslatorPropertyTranslator

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

A property translator that uses {@see TranslatorInterface}.

Method Details

Hide inherited methods

__construct() public method

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

Translator to use.

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

            
translate() public method

public string translate ( string $property )
$property string

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