ZF 응용 프로그램에서 XML을 반환하는 데 문제가 있습니다. 내 코드 :Zend Framework 응용 프로그램에서 XML을 반환하는 방법
class ProjectsController extends Gid_Controller_Action
{
public function xmlAction()
{
$content = "<?xml version='1.0'><foo>bar</foo>";
header('Content-Type: text/xml');
echo $content;
}
}
는 또한 시도한 다음
는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();
}
}
누군가는 이것을 달성하는 방법을 올바른 방향으로 날 지점 수 있을까요?
어떻게 젠드 프레임 워크 3에서 동일한 작업을 수행하기 위해 다음과 같습니다
당신이 원하는 일을해야 샘플 컨트롤러? –