api.php
上传用户:shuoshiled
上传日期:2018-01-28
资源大小:10124k
文件大小:1k
源码类别:

中间件编程

开发平台:

JavaScript

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