X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/direct/php/api.php?ds=sidebyside diff --git a/examples/direct/php/api.php b/examples/direct/php/api.php index a1a6828c..f595275e 100644 --- a/examples/direct/php/api.php +++ b/examples/direct/php/api.php @@ -1,31 +1,38 @@ -&$a){ - $methods = array(); - foreach($a['methods'] as $mname=>&$m){ - $md = array( - 'name'=>$mname, - 'len'=>$m['len'] - ); - if(isset($m['formHandler']) && $m['formHandler']){ - $md['formHandler'] = true; - } - $methods[] = $md; - } - $actions[$aname] = $methods; -} - -$cfg = array( - 'url'=>'php/router.php', - 'type'=>'remoting', - 'actions'=>$actions -); - -echo 'Ext.app.REMOTING_API = '; - -echo json_encode($cfg); -echo ';'; +&$a){ + $methods = array(); + foreach($a['methods'] as $mname=>&$m){ + if (isset($m['len'])) { + $md = array( + 'name'=>$mname, + 'len'=>$m['len'] + ); + } else { + $md = array( + 'name'=>$mname, + 'params'=>$m['params'] + ); + } + if(isset($m['formHandler']) && $m['formHandler']){ + $md['formHandler'] = true; + } + $methods[] = $md; + } + $actions[$aname] = $methods; +} + +$cfg = array( + 'url'=>'php/router.php', + 'type'=>'remoting', + 'actions'=>$actions +); + +echo 'Ext.ns("Ext.app"); Ext.app.REMOTING_API = '; + +echo json_encode($cfg); +echo ';';