How to render XML response in Zend Framework 2

0 Flares Twitter 0 Facebook 0 LinkedIn 0 0 Flares ×

Zend Framework 2 offers different Rendering and Response Strategies.

Unfortunately there is no out-of-the-box Strategy for XML.

Solely RSS Feeds are supported:

Well, there is a Module by Alessandro Pietrobelli:

If you want to render raw XML you can use these simple lines in your controller:


If you need to create complex XML files you can use the PHP XMLWriter which is included in ZF2:



Web Deviloper