Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

tokuhirom (7396)

tokuhirom
  (email not shown publicly)
http://d.hatena.ne.jp/tokuhirom/

Journal of tokuhirom (7396)

Saturday November 04, 2006
10:12 AM

usage of sledge::view

[ #31510 ]

follow is an examle trigger code of Sledge::View.

package Your::Pages::Base;
use strict;
use warnings;
use base qw/Sledge::Pages::Compat/;
use Switch;
use Jcode;
use Sledge::Plugin::PluginLoader;
__PACKAGE__->load_plugins(
  qw/Stash View/
);
 
__PACKAGE__->add_trigger(
    AFTER_DISPATCH => sub {
        my $self = shift;
 
        switch ($self->r->param('output')) {
            case 'csv' {
                $self->view('Sledge::View::CSV')->process;
                $self->response->body(Jcode->new($self->response->body, 'euc')->sjis);
            }
            else {
                $self->view('Template')->process;
            }
        }
    }
);
 
1;

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.