Hi all,
I'm having problems returning XML in my ZF Application.
Below is the code I have:
<?php
class ProjectsController extends Gid_Controller_Action
{
public function xmlAction ()
{
$content = "<?xml version='1.0'><foo>bar</foo>";
header('Content-Type: text/xml');
echo $content;
}
}
?>
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-tp25818727p25818727.html
Sent from the Zend Framework mailing list archive at Nabble.com.