Giving 2 parameters to remote_function using 'with'
I'm trying to give several parameters in a remote_function
like this:
<?php
echo remote_function(array( 'update' => 'test',
'url' => 'conges/verifdate',
'with' => "'date_deb=' + $('date_debut').value"
));
?>
This code works (in my action.class
I can get the parameter).
But when I开发者_运维百科 try to give a second parameter, it doesn't work:
<?php
echo remote_function(array( 'update' => 'test',
'url' => 'conges/verifdate',
'with' => "'date_deb=' + $('date_debut').value"."'+&date_fin=' + $('date_fin')"
))
?>
What am I doing wrong?
I did it like this:
'url' => 'conges/verifdate?vars=serialize(array("var1" => 1, "var2" => 2))'
In your remote action you do:
$vars = unserialize($request->getParameter('vars'));
精彩评论