Using Extjs 4 as a Rest Client to Zend

As the Zend framework uses MVC and Extjs 4 is heavily pushing their new MVC architecture the two working together should be a good fit... Unfortunately the default url formats are slightly different, but enough to break out of the box compatibility. I won't delve into the reasons, rather read this.

Zend:
Using the Zend_Rest_Route framework router enables an application to receive and handle REST actions (PUT, POST, DELETE, GET) in a standardised method and expects a Url in the format of (simple key):
http:/www.example.com/{module}/{controller}/{idkey}/{idvalue}

Extjs:
Is able to send the standard REST verbs, but by default the url is of the format:
http:/www.example.com/{module}/{controller}/{idvalue}
Thus we end up with the two frameworks being unable to communicate (using the standard REST protocol anyway).

The solution: