Yes, that is the correct approach.
David
--
David Zülke
[EMAIL PROTECTED]
Tel: +49 (0)89 21 58 27 53
Fax: +49 (0)89 21 58 27 55
bitXtender GbR
Scherbaumstr. 19
81737 München
Am 29.03.2007 um 09:30 schrieb Daniel Swarbrick:
> In the past, I've saveXML()'ed the XML string to a template variable,
> and echoed it from the template, but after examining the xmlrpc
> stuff in
> the sample app, I don't think this is the best way to do it.
>
> What I've come up with, I hope is correct. As per my previous
> method, I
> still have an xml output type defined in output_types.xml:
>
> <output_type name="xml">
> <parameters>
> <parameter name="http_headers">
> <parameter name="Content-Type">text/xml; charset=UTF-8</
> parameter>
> </parameter>
> </parameters>
> </output_type>
>
> Note there is no renderers or layouts block for this output type.
>
> I ensure that routing knows this request will _always_ serve xml:
>
> <route pattern="^/sysinfo$" module="%actions.default_module%"
> action="SysInfo" output_type="xml" />
>
> Then in my view, I have an executeXml():
>
> public function executeXml(AgaviRequestDataHolder $rd)
> {
> $xmlDoc = new DomDocument('1.0');
>
> $root = $xmlDoc->createElement('myxml');
> $xmlDoc->appendChild($root);
>
> $foo = $xmlDoc->createElement('blah', 'foofoo');
> $root->appendChild($foo);
>
> $xmlDoc->formatOutput = true;
> $this->getResponse()->setContent($xmlDoc->saveXML());
> }
>
> which directly injects the xml string into the response content. No
> template setup.
>
> Is this the most elegant way of going about it?
>
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.agavi.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users