|
NAMECatalyst::View::XML::Simple SYNOPSISpackage 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>
}
METHODSprocessrenderAUTHORNAKAGAWA Masaki <masaki@cpan.org> LICENSEThis library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSOXML::Simple, Catalyst::View::JSON, Catalyst::View
|