{"action":"created","issue":{"url":"https://api.github.com/repos/WeAreAthlon/silla.io/issues/35","labels_url":"https://api.github.com/repos/WeAreAthlon/silla.io/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/WeAreAthlon/silla.io/issues/35/comments","events_url":"https://api.github.com/repos/WeAreAthlon/silla.io/issues/35/events","html_url":"https://github.com/WeAreAthlon/silla.io/issues/35","id":54063312,"number":35,"title":"Render Output Module","user":{"login":"sandio","id":3699023,"avatar_url":"https://avatars.githubusercontent.com/u/3699023?v=3","gravatar_id":"","url":"https://api.github.com/users/sandio","html_url":"https://github.com/sandio","followers_url":"https://api.github.com/users/sandio/followers","following_url":"https://api.github.com/users/sandio/following{/other_user}","gists_url":"https://api.github.com/users/sandio/gists{/gist_id}","starred_url":"https://api.github.com/users/sandio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandio/subscriptions","organizations_url":"https://api.github.com/users/sandio/orgs","repos_url":"https://api.github.com/users/sandio/repos","events_url":"https://api.github.com/users/sandio/events{/privacy}","received_events_url":"https://api.github.com/users/sandio/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/WeAreAthlon/silla.io/labels/feature","name":"feature","color":"006b75"},{"url":"https://api.github.com/repos/WeAreAthlon/silla.io/labels/medium+priority","name":"medium priority","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"pnikolov","id":319266,"avatar_url":"https://avatars.githubusercontent.com/u/319266?v=3","gravatar_id":"","url":"https://api.github.com/users/pnikolov","html_url":"https://github.com/pnikolov","followers_url":"https://api.github.com/users/pnikolov/followers","following_url":"https://api.github.com/users/pnikolov/following{/other_user}","gists_url":"https://api.github.com/users/pnikolov/gists{/gist_id}","starred_url":"https://api.github.com/users/pnikolov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnikolov/subscriptions","organizations_url":"https://api.github.com/users/pnikolov/orgs","repos_url":"https://api.github.com/users/pnikolov/repos","events_url":"https://api.github.com/users/pnikolov/events{/privacy}","received_events_url":"https://api.github.com/users/pnikolov/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/WeAreAthlon/silla.io/milestones/1","labels_url":"https://api.github.com/repos/WeAreAthlon/silla.io/milestones/1/labels","id":931185,"number":1,"title":"next","description":"","creator":{"login":"sandio","id":3699023,"avatar_url":"https://avatars.githubusercontent.com/u/3699023?v=3","gravatar_id":"","url":"https://api.github.com/users/sandio","html_url":"https://github.com/sandio","followers_url":"https://api.github.com/users/sandio/followers","following_url":"https://api.github.com/users/sandio/following{/other_user}","gists_url":"https://api.github.com/users/sandio/gists{/gist_id}","starred_url":"https://api.github.com/users/sandio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandio/subscriptions","organizations_url":"https://api.github.com/users/sandio/orgs","repos_url":"https://api.github.com/users/sandio/repos","events_url":"https://api.github.com/users/sandio/events{/privacy}","received_events_url":"https://api.github.com/users/sandio/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":0,"state":"open","created_at":"2015-01-12T09:10:29Z","updated_at":"2015-01-20T13:23:20Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-01-12T15:04:54Z","updated_at":"2015-01-21T16:17:09Z","closed_at":null,"body":"Core module for rendering output consisting of:\r\n- Adapters\r\n - [x] Smarty\r\n - [ ] JSON\r\n- [x] Caching support"},"comment":{"url":"https://api.github.com/repos/WeAreAthlon/silla.io/issues/comments/70866727","html_url":"https://github.com/WeAreAthlon/silla.io/issues/35#issuecomment-70866727","issue_url":"https://api.github.com/repos/WeAreAthlon/silla.io/issues/35","id":70866727,"user":{"login":"kmotsov","id":1753390,"avatar_url":"https://avatars.githubusercontent.com/u/1753390?v=3","gravatar_id":"","url":"https://api.github.com/users/kmotsov","html_url":"https://github.com/kmotsov","followers_url":"https://api.github.com/users/kmotsov/followers","following_url":"https://api.github.com/users/kmotsov/following{/other_user}","gists_url":"https://api.github.com/users/kmotsov/gists{/gist_id}","starred_url":"https://api.github.com/users/kmotsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmotsov/subscriptions","organizations_url":"https://api.github.com/users/kmotsov/orgs","repos_url":"https://api.github.com/users/kmotsov/repos","events_url":"https://api.github.com/users/kmotsov/events{/privacy}","received_events_url":"https://api.github.com/users/kmotsov/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T16:17:09Z","updated_at":"2015-01-21T16:17:09Z","body":"According to me for now it should be a pretty simple adapter. \r\n\r\nSome general behaviour as I see it: \r\n* If output is set explicitly the adapter should not make any changes to it.\r\n* Otherwise the adapter should work exactly as a smarty adapter\r\n  * Render the corresponding view with `json.tpl` extension\r\n  * All assigned variables in the action should be available in the view\r\n  * A smarty helper function will be created, that should be able to support the following usages: \r\n\r\n     ```\r\n      {if $params.orders eq true}\r\n          {json from = $customers, fields = ['id', 'name'], item = customer}\r\n              {if $item->has_orders}\r\n                  {json $item->orders, ['id', 'price']}\r\n              {/if}\r\n          {/json}\r\n      {else}\r\n           {json from = $customers, fields = ['id', 'name']}{/json}\r\n      {/if}\r\n     ```\r\n* Not sure if this is possible in the current structure, but ideally  the adapter should set a response header `Content-Type` to the value of an instance variable (called for example `content_type`) of the adapter that should default to `application\\json` and should be changeable in the controller's action."}}