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