我试图使用输入过滤器验证乘法选择,但每次看到错误.错误是"notInArray":"在大海捞针中找不到输入".(我使用ajax,但它并不是完美的).我将更清楚地展示我的部分代码.
在控制器中:
if ($request->isPost()) {
$post = $request->getPost();
$form = new \Settings\Form\AddUserForm($roles);//
$form->get('positions')
->setOptions(
array('value_options'=> $post['positions']));
Run Code Online (Sandbox Code Playgroud)
//.... more code...
$this->add(array(
'type' => 'Zend\Form\Element\Select',
'attributes' => array(
'multiple' => 'multiple',
'id' => 'choosed_positions',
),
'required' => false,
'name' => 'positions',
));
Run Code Online (Sandbox Code Playgroud)
//.... more code...
当我把print_r($ post ['positions']); 我明白了:array(0 => 118,1 => 119)
in ..../form/UserForm.php我创建了multiply元素
$inputFilter->add($factory->createInput(array(
'name' => 'positions',
'required' => false,
'validators' => array(
array(
'name' => 'InArray',
'options' => array(
'haystack' => array(118,119),
'messages' => array(
'notInArray' => 'Please select …Run Code Online (Sandbox Code Playgroud) 我想启用magento编译,但是当我启用它时,我看到跟随错误:
警告:include_once(.../includes/src/Mage_Core_functions.php)[function.include-once]:无法打开流:第36行的/ app/Mage.php中没有这样的文件或目录
警告:include_once ()[function.include]:无法打开'.../includes/src/Mage_Core_functions.php'以包含(include_path ='/ .../includes/src:.:/ usr/share/php')in.第36行的../app/Mage.php警告:include_once(.../includes/src/Varien_Autoload.php)[function.include-once]:无法打开流:第37行的/.../app/Mage.php中没有此类文件或目录
警告: include_once()[function.include]:无法打开'.../includes/src/Varien_Autoload.php'(include_path ='.../includes/src:.:/ usr/share/php')in.第37行的../app/Mage.php
致命错误:第53行的.../app/Mage.php中找不到"Varien_Autoload"类
任何人都可以帮我修理它们吗?我想要启用编译.在互联网上,关于这个问题的每个答案都禁用了编译.我想要启用编译.仅供参考,我的magento版本是1.7.0.0