jmathai/epiphany — pull request #40 by mac2000 (2012-08-08 11:45:49+00:00)
Title: [proposal] jsonp callback

You have great `EpiApi` class which do very good job, until I want to make java script requests from another domain

Use case example:

```php

set('base', '/rest');

getRoute()->get('/users', 'showUsers');
getApi()->get('/users.json', 'apiUsers', EpiApi::external);
getRoute()->run();

function apiUsers() {
return array('Alex', 'Jim', 'Santa');
}

function showUsers() {
echo implode(', ', apiUsers());
}
```

### /users

Alex, Jim, Santa

### /users.json

["Alex", "Jim", "Santa"]

### /users.json?callback=cb

cb(["Alex", "Jim", "Santa"])

### calling from another domain

$.getJSON('http://example.com/users.json?callback=?', function(data){
alert(data.join(', '));
});