我花了一整夜试图弄清楚为什么这段代码不起作用
$inputFilter = new InputFilter();
$factory = new InputFactory();
$translator = new \Zend\I18n\Translator\Translator();
//Copy of file found in resources/languages/es/Zend_Validate.php
$translator->addTranslationFile('phparray', './module/Product/language/zend_validate.php');
$inputFilter->add(
$factory->createInput(
array(
'name' => 'idpro',
'required' => true,
'filters' => array(
array('name' => 'Int'),
),
)
)
);
$inputFilter->add(
$factory->createInput(
array(
'name' => 'nompro',
'validators' => array(
array(
'name' => 'EmailAddress',
'options' => array(
'translator' => $translator
)
),
),
)
)
);
我已经安装了 php5-intl 并在 php.ini 中启用了它
但它不起作用我得到相同的消息Value is required 并且不能为空,但它应该是翻译的......
非常感谢你 !