Zend output XML


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $this->_helper->layout()->disableLayout();
  2. $this->_helper->viewRenderer->setNoRender(true);
  3.  
  4. $xml = new DOMDocument('1.0', 'utf-8');
  5. $xml->appendChild($xml->createElement('video', 'link'));
  6. $output = $xml->saveXML();
  7.  
  8. Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true);
  9. Zend_Layout::getMvcInstance()->disableLayout();
  10.  
  11. $this->_response->setHeader('Content-Type', 'text/xml; charset=utf-8')
  12. ->setBody($output);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.