zfcampus/apigility-documentation — pull request #37 by egyptianbman (2014-07-17 16:44:06+00:00)
Title: Add an example for collection in RPC

I couldn't simply return a `new Collection($users)` object within `payload`, I kept getting an error:

```javascript
{
status: 500
title: "Unexpected error"
describedBy: "http:\/\/www.w3.org\/Protocols\/rfc2616\/rfc2616-sec10.html"
detail: "Link from resource provided to ZF\\Hal\\Plugin\\Hal::fromLink was incomplete; must contain a URL or a route"
}
```

I was able to get it to work by having the `hal` plugin create the `Hal\Collection` object.