File: Flash.pm

package info (click to toggle)
libcatalyst-plugin-session-store-dbic-perl 0.14-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 136 kB
  • sloc: perl: 309; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 440 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package TestApp::Controller::Flash;

use strict;
use warnings;
use base qw/Catalyst::Controller/;

sub setup : Local {
    my ($self, $c) = @_;

    my $key   = $c->req->param('key')   || 'key';
    my $value = $c->req->param('value') || 1;

    $c->flash->{$key} = $value;
    $c->res->body('ok');
}

sub output : Local {
    my ($self, $c) = @_;

    my $key = $c->req->param('key') || 'key';

    $c->res->body($c->flash->{$key});
}

1;