Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. Request URL:http://localhost/service/destroy/news.php?_dc=1357565811429
  2. Request Method:POST
  3. Status Code:200 OK
  4. Query String Parameters:
  5. _dc:1357565811429
  6. Request Payload:
  7. {"items":{"id":5}}
  8.  
  9. Request URL:http://localhost/service/update/news.php?_dc=1357566047052
  10. Request Method:POST
  11. Status Code:200 OK
  12. Query String Parameters:
  13. _dc:1357566047052
  14. Request Payload:
  15. {"items":{"datepubl":"2012-12-01T00:00:00","title":"the Update Plan","alias":"the-update-plan","new":"<p>small text new</p>","newfull":"<p>full text new</p>","id":4}}
  16.  
  17. Request URL:http://localhost/service/create/news.php?_dc=1357566179903
  18. Request Method:POST
  19. Status Code:200 OK
  20. Query String Parameters:
  21. _dc:1357566179903
  22. Request Payload:
  23. {"items":{"id":0,"datepubl":null,"dateclose":null,"title":"the NEW new","alias":"the-new-new","new":"text the NEW new","newfull":""}}
  24.  
  25. var storeNews = Ext.create('Ext.data.Store', {
  26. autoLoad: true,
  27. autoSync: true,
  28. idProperty: 'id',
  29. remoteFilter: true,
  30. fields: [
  31. { name: 'id', type: 'int' },
  32. { name: 'datepubl', type: 'date' },
  33. { name: 'dateclose', type: 'date' },
  34. { name: 'title', type: 'string' },
  35. { name: 'alias', type: 'string' },
  36. { name: 'new', type: 'string' },
  37. { name: 'newtext', type: 'string' }
  38. ],
  39. proxy: {
  40. type: 'ajax',
  41. api: {
  42. read: 'service/view/news.php',
  43. create: 'service/create/news.php',
  44. update: 'service/update/news.php',
  45. destroy: 'service/destroy/news.php'
  46. },
  47. reader: {
  48. type: 'json',
  49. successProperty: 'success',
  50. root: 'data',
  51. messageProperty: 'message'
  52. },
  53. writer: {
  54. type: 'json',
  55. writeAllFields: false,
  56. root: 'data'
  57. },
  58. listeners: {
  59. exception: function(proxy, response, operation){
  60. Ext.MessageBox.show({
  61. title: 'REMOTE EXCEPTION',
  62. msg: operation.getError(),
  63. icon: Ext.MessageBox.ERROR,
  64. buttons: Ext.Msg.OK
  65. });
  66. }
  67. }
  68. }
  69. });
  70.  
  71. $data = json_decode(file_get_contents('php://input'));
  72.  
  73. print( json_encode( $data ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement