-
-
Notifications
You must be signed in to change notification settings - Fork 61
error on documentation example code #25
Copy link
Copy link
Open
Labels
Description
The section "Using pre-translated validation messages" on the Zend Validator documentaion has the following example:
use Zend\I18n\Translator\Resources;
use Zend\Mvc\I18n\Translator;
use Zend\Validator\AbstractValidator;
$translator = new Zend\Mvc\I18n\Translator();
$translator->addTranslationFilePattern(
'phpArray',
Resources::getBasePath(),
Resources::getPatternForValidator()
);
AbstractValidator::setDefaultTranslator($translator);
Fist Zend\Mvc\I18n\Translator(); needs an I18nTranslatorInterface and that's not documented on this example.
The another problem with this example is that it throws this Exception:
A plugin by the name "phpArray" was not found in the plugin manager Zend\I18n\Translator\LoaderPluginManager
Because the alias for Zend\I18n\Translator\Loader\PhpArray now is "phparray" not "phpArray"
Originally posted by @igormx at zendframework/zend-validator#106
Reactions are currently unavailable