Catalyst::View::XML::Simple
package MyApp::View::XML;
use base 'Catalyst::View::XML::Simple';
__PACKAGE__->config(expose_stash => 'response');
in your controller:
package MyApp::Controller::Foo;
sub bar : Local {
my ($self, $c) = @_;
$c->stash->{response} = {
code => 0,
message => 'blah blah blah',
};
}
sub end : Private {
my ($self, $c) = @_;
$c->forward( $c->view('XML') );
# <response>
# <code>0</code>
# <message>blah blah blah</message>
# </response>
}
NAKAGAWA Masaki <masaki@cpan.org>
This library is free software, you can redistribute it and/or modify it under
the same terms as Perl itself.
XML::Simple, Catalyst::View::JSON, Catalyst::View