Moxy::Plugin::ShowHTMLSource - show html source in control panel.


Moxy documentation Contained in the Moxy distribution.

Index


Code Index:

NAME

Top

Moxy::Plugin::ShowHTMLSource - show html source in control panel.

SYNOPSIS

Top

  - module: ShowHTMLSource

DESCRIPTION

Top

show html source on control panel, for debugging.

AUTHOR

Top

Tokuhiro Matsuno


Moxy documentation Contained in the Moxy distribution.

package Moxy::Plugin::ShowHTMLSource;
use strict;
use warnings;
use base qw/Moxy::Plugin/;
use Encode;

# FIXME: mojibake

sub control_panel :Hook {
    my ($self, $context, $args) = @_;

    $context->log(debug => 'dump html source');

    my $charset = $args->{response}->charset;
    my $enc = Encode::find_encoding($charset);
    return $self->render_template(
        $context,
        'panel.tt' => {
            html => decode($enc, $args->{response}->content()),
        }
    );
}

1;
__END__