{"action":"created","issue":{"url":"https://api.github.com/repos/alexweissman/UserFrosting/issues/322","labels_url":"https://api.github.com/repos/alexweissman/UserFrosting/issues/322/labels{/name}","comments_url":"https://api.github.com/repos/alexweissman/UserFrosting/issues/322/comments","events_url":"https://api.github.com/repos/alexweissman/UserFrosting/issues/322/events","html_url":"https://github.com/alexweissman/UserFrosting/issues/322","id":80749023,"number":322,"title":"0.3.0 Ajax Best Practices -- Server Side","user":{"login":"r3wt","id":4483325,"avatar_url":"https://avatars.githubusercontent.com/u/4483325?v=3","gravatar_id":"","url":"https://api.github.com/users/r3wt","html_url":"https://github.com/r3wt","followers_url":"https://api.github.com/users/r3wt/followers","following_url":"https://api.github.com/users/r3wt/following{/other_user}","gists_url":"https://api.github.com/users/r3wt/gists{/gist_id}","starred_url":"https://api.github.com/users/r3wt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r3wt/subscriptions","organizations_url":"https://api.github.com/users/r3wt/orgs","repos_url":"https://api.github.com/users/r3wt/repos","events_url":"https://api.github.com/users/r3wt/events{/privacy}","received_events_url":"https://api.github.com/users/r3wt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/alexweissman/UserFrosting/labels/0.3.0","name":"0.3.0","color":"207de5"},{"url":"https://api.github.com/repos/alexweissman/UserFrosting/labels/standards%20and%20best%20practices","name":"standards and best practices","color":"5319e7"},{"url":"https://api.github.com/repos/alexweissman/UserFrosting/labels/todo","name":"todo","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"r3wt","id":4483325,"avatar_url":"https://avatars.githubusercontent.com/u/4483325?v=3","gravatar_id":"","url":"https://api.github.com/users/r3wt","html_url":"https://github.com/r3wt","followers_url":"https://api.github.com/users/r3wt/followers","following_url":"https://api.github.com/users/r3wt/following{/other_user}","gists_url":"https://api.github.com/users/r3wt/gists{/gist_id}","starred_url":"https://api.github.com/users/r3wt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r3wt/subscriptions","organizations_url":"https://api.github.com/users/r3wt/orgs","repos_url":"https://api.github.com/users/r3wt/repos","events_url":"https://api.github.com/users/r3wt/events{/privacy}","received_events_url":"https://api.github.com/users/r3wt/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-05-26T02:21:34Z","updated_at":"2015-05-28T01:00:06Z","closed_at":null,"body":"Move all ajax related routes to an universal ajax controller.\r\n\r\nExample of how this works:\r\nhttps://github.com/r3wt/StarterKit/blob/master/libs/routes.php#L11\r\n```php\r\n$app->map('/ajax/:method',function($method) use($app){\r\n (new AjaxController)->_try($method);\r\n})->via('GET','POST');\r\n```\r\n\r\nhttps://github.com/r3wt/StarterKit/blob/master/libs/StarterKit/Routes/AjaxController.php\r\n\r\nAjax controller extends JSON Controller...\r\n\r\nhttps://github.com/r3wt/StarterKit/blob/master/libs/StarterKit/Routes/JsonController.php\r\n\r\nMethods in Ajax class should either return an array in the format of\r\n```\r\n['error'=>0,'message'=> whatever you want to put here, can be an object can be a message  ]\r\n```\r\nor throw an exception. the Json controller will catch exceptions and output\r\n\r\n```\r\n['error'=>1,'message'=>$e->getMessage()]\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/alexweissman/UserFrosting/issues/comments/106128016","html_url":"https://github.com/alexweissman/UserFrosting/issues/322#issuecomment-106128016","issue_url":"https://api.github.com/repos/alexweissman/UserFrosting/issues/322","id":106128016,"user":{"login":"r3wt","id":4483325,"avatar_url":"https://avatars.githubusercontent.com/u/4483325?v=3","gravatar_id":"","url":"https://api.github.com/users/r3wt","html_url":"https://github.com/r3wt","followers_url":"https://api.github.com/users/r3wt/followers","following_url":"https://api.github.com/users/r3wt/following{/other_user}","gists_url":"https://api.github.com/users/r3wt/gists{/gist_id}","starred_url":"https://api.github.com/users/r3wt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r3wt/subscriptions","organizations_url":"https://api.github.com/users/r3wt/orgs","repos_url":"https://api.github.com/users/r3wt/repos","events_url":"https://api.github.com/users/r3wt/events{/privacy}","received_events_url":"https://api.github.com/users/r3wt/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T01:00:06Z","updated_at":"2015-05-28T01:00:06Z","body":"Not my fault everyone else is retarded."}}