PageRenderTime 41ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/ext-4.0.7/examples/direct/php/api.php

https://bitbucket.org/srogerf/javascript
PHP | 38 lines | 33 code | 4 blank | 1 comment | 4 complexity | 777d22f8baafbeb66fc4493706093300 MD5 | raw file
  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. if (isset($m['len'])) {
  10. $md = array(
  11. 'name'=>$mname,
  12. 'len'=>$m['len']
  13. );
  14. } else {
  15. $md = array(
  16. 'name'=>$mname,
  17. 'params'=>$m['params']
  18. );
  19. }
  20. if(isset($m['formHandler']) && $m['formHandler']){
  21. $md['formHandler'] = true;
  22. }
  23. $methods[] = $md;
  24. }
  25. $actions[$aname] = $methods;
  26. }
  27. $cfg = array(
  28. 'url'=>'php/router.php',
  29. 'type'=>'remoting',
  30. 'actions'=>$actions
  31. );
  32. echo 'Ext.ns("Ext.app"); Ext.app.REMOTING_API = ';
  33. echo json_encode($cfg);
  34. echo ';';