¿De qué forma puedo retornar un xml en una aplicación hecha con zend framework?
¡
Retornar xml - Zend Framework
Iniciado por
Gabriel Estrada
, jun 22 2014 23:06
#1 AUTOR PREGUNTA
Esto también te interesa!
#2
Publicado 23 junio 2014 - 05:32
Prueba con lo siguiente:
<?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; } } ?>
#3
Publicado 23 junio 2014 - 05:42
En base al código anterior tambien lo puedes hacer de esta forma:
<?php class ProjectsController extends Gid_Controller_Action {
public function init() {
$contextSwitch = $this->_helper->getHelper('contextSwitch'); $contextSwitch->addActionContext('xml', 'xml')->initContext('xml'); }
public function xmlAction() {
}
}