2010-06-17 47 views
1

我想給幾個參數在remote_function這樣remote_function:給予2個參數用「與」

<?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')" 
        )) 
?> 

我在做什麼錯?

回答

0

我做了這樣的:

'url' => 'conges/verifdate?vars=serialize(array("var1" => 1, "var2" => 2))' 

在你遠程操作你做:

$vars = unserialize($request->getParameter('vars')); 
+0

我看見你我missunderstood你的問題,也許這個鏈接是有幫助的:HTTP:// onrails。 org/articles/2006/05/01/remote_function-with – ownking 2010-06-17 18:04:39

+0

tigerstyle:我正在使用Symfony而不是Ruby – bahamut100 2010-06-17 20:30:40

相關問題