You really only need this one line

$this->getResponse()->setheader('Content-Type', 'text/xml');

It should work fine.

Cheers


Jayawi wrote:
> 
> I've also tried the following:
> 
>     <?php
>     class ProjectsController extends Gid_Controller_Action
>     {
>      public function xmlAction ()
>      {
>       $content = "<?xml version='1.0'><foo>bar</foo>";
>       $this->getResponse()->clearHeaders();
>       $this->getResponse()->setheader('Content-Type', 'text/xml');
>       $this->getResponse()->setBody($content);
>       $this->getResponse()->sendResponse();
>      }
>     }
>     ?>
> 
> Could someone point me in the right direction as to how I go about
> achieving this?
> Thank you very much.
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-return-XML-in-an-Zend-Framework-Application-tp25818727p25852125.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to