View on
MetaCPAN
Travis Chase > Catalyst-View-Download-0.09 > Catalyst::View::Download::HTML

Download:
Catalyst-View-Download-0.09.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  0
View/Report Bugs
Module Version: 0.05   Source  

NAME ^

Catalyst::View::Download::HTML

VERSION ^

0.05

SYNOPSIS ^

    # lib/MyApp/View/Download/HTML.pm
    package MyApp::View::Download::HTML;
    use base qw( Catalyst::View::Download::HTML );
    1;

    # lib/MyApp/Controller/SomeController.pm
    sub example_action_1 : Local {
        my ($self, $c) = @_;

        my $content = "Some Text";

        # To output your data just pass your content into the 'html' key of the stash
        $c->stash->{'html'} = $content;

        # Or into the body of the response for this action
        $c->response->body($content);

        # Finally forward processing to the HTML View
        $c->forward('MyApp::View::Download::HTML');
    }

DESCRIPTION ^

Takes content and outputs the content as html text.

SUBROUTINES ^

process

This method will be called by Catalyst if it is asked to forward to a component without a specified action.

render

Allows others to use this view for much more fine-grained content generation.

CONFIG ^

stash_key

Determines the key in the stash this view will look for when attempting to retrieve content to process. If this key isn't found it will then look at $c->response->body for content.

  $c->view('MyApp::View::Download::HTML')->config->{'stash_key'} = 'content';

AUTHOR ^

Travis Chase, <gaudeon at cpan dot org>

SEE ALSO ^

Catalyst Catalyst::View Catalyst::View::Download

LICENSE ^

Copyright 2011 Travis Chase.

This program is free software. You can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: