Upgrade to ExtJS 3.0.3 - Released 10/11/2009
[extjs.git] / examples / direct / php / api.php
1 <?php\r
2 require('config.php');\r
3 header('Content-Type: text/javascript');\r
4 \r
5 // convert API config to Ext.Direct spec\r
6 $actions = array();\r
7 foreach($API as $aname=>&$a){\r
8         $methods = array();\r
9         foreach($a['methods'] as $mname=>&$m){\r
10                 $md = array(\r
11                         'name'=>$mname,\r
12                         'len'=>$m['len']\r
13                 );\r
14                 if(isset($m['formHandler']) && $m['formHandler']){\r
15                         $md['formHandler'] = true;\r
16                 }\r
17                 $methods[] = $md;\r
18         }\r
19         $actions[$aname] = $methods;\r
20 }\r
21 \r
22 $cfg = array(\r
23     'url'=>'php/router.php',\r
24     'type'=>'remoting',\r
25         'actions'=>$actions\r
26 );\r
27 \r
28 echo 'Ext.app.REMOTING_API = ';\r
29 \r
30 echo json_encode($cfg);\r
31 echo ';';\r