In the DevZone of ZF there’s a good tutorial: my aim is to give you a silly example of how to deliver content as XML in ZF and/or Magento.
Create a simple action in your controller:
1 2 3 4 5 6 |
|
which we’re gonna use to construct a single-node ( sooo silly example ) XML structure.
First we create the DOMDocument:
1 2 3 |
|
then we create our nodes:
1 2 3 |
|
We close this routine operations telling that the output has to be saved as XML, but also that the headers might fit XML requirements:
1 2 3 4 |
|
That’s it!