protected function getValidationConfiguration(Field $field, $validationName, Validation $validatorConfiguration)
    {
        $acceptsEmptyValues = ValidatorService::get()->validatorAcceptsEmptyValues($validatorConfiguration->getClassName());

        /** @var FormzLocalizationJavaScriptAssetHandler $formzLocalizationJavaScriptAssetHandler */
        $formzLocalizationJavaScriptAssetHandler = $this->assetHandlerFactory->getAssetHandler(FormzLocalizationJavaScriptAssetHandler::class);

        $messages = $formzLocalizationJavaScriptAssetHandler->getTranslationKeysForFieldValidation($field, $validationName);

        return ArrayService::get()->arrayToJavaScriptJson([
            'options'            => $validatorConfiguration->getOptions(),
            'messages'           => $messages,
            'settings'           => $validatorConfiguration->toArray(),
            'acceptsEmptyValues' => $acceptsEmptyValues
        ]);
    }
protected function getValidationConfiguration(Field $field, $validationName, Validation $validatorConfiguration)
    {
        $acceptsEmptyValues = ValidatorService::get()->validatorAcceptsEmptyValues($validatorConfiguration->getClassName());

        /** @var FormzLocalizationJavaScriptAssetHandler $formzLocalizationJavaScriptAssetHandler */
        $formzLocalizationJavaScriptAssetHandler = $this->assetHandlerFactory->getAssetHandler(FormzLocalizationJavaScriptAssetHandler::class);

        $messages = $formzLocalizationJavaScriptAssetHandler->getTranslationKeysForFieldValidation($field, $validationName);

        return ArrayService::get()->arrayToJavaScriptJson([
            'options'            => $validatorConfiguration->getOptions(),
            'messages'           => $messages,
            'settings'           => $validatorConfiguration->toArray(),
            'acceptsEmptyValues' => $acceptsEmptyValues
        ]);
    }
protected function getValidationConfiguration ( Field $ field , $ validationName , Validation $ validatorConfiguration ) { $ acceptsEmptyValues = ValidatorService :: get ( ) -> validatorAcceptsEmptyValues ( $ validatorConfiguration -> getClassName ( ) ) ; /** @var FormzLocalizationJavaScriptAssetHandler $formzLocalizationJavaScriptAssetHandler */ $ formzLocalizationJavaScriptAssetHandler = $ this -> assetHandlerFactory -> getAssetHandler ( FormzLocalizationJavaScriptAssetHandler :: class ) ; $ messages = $ formzLocalizationJavaScriptAssetHandler -> getTranslationKeysForFieldValidation ( $ field , $ validationName ) ; return ArrayService :: get ( ) -> arrayToJavaScriptJson ( [ 'options' => $ validatorConfiguration -> getOptions ( ) , 'messages' => $ messages , 'settings' => $ validatorConfiguration -> toArray ( ) , 'acceptsEmptyValues' => $ acceptsEmptyValues ] ) ; }
Returns a JSON array containing the validation configuration needed by
JavaScript.

@param Field      $field
@param string     $validationName
@param Validation $validatorConfiguration
@return string
Returns a JSON array containing the validation configuration needed by JavaScript .