我试图在 remote_function
中给出几个参数,如下所示:
<?php
echo remote_function(array( 'update' => 'test',
'url' => 'conges/verifdate',
'with' => "'date_deb=' + $('date_debut').value"
));
?>
这段代码有效(在我的action.class
中我可以获取参数)。
但是当我尝试提供第二个参数时,它不起作用:
<?php
echo remote_function(array( 'update' => 'test',
'url' => 'conges/verifdate',
'with' => "'date_deb=' + $('date_debut').value"."'+&date_fin=' + $('date_fin')"
))
?>
我做错了什么?
最佳答案
我是这样做的:
'url' => 'conges/verifdate?vars=serialize(array("var1" => 1, "var2" => 2))'
在远程操作中,您执行以下操作:
$vars = unserialize($request->getParameter('vars'));
关于javascript - 使用 'with' 为remote_function提供2个参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3061857/