|
Catalyst::Plugin::StashSetter - stash setter for Catalyst |
Catalyst::Plugin::StashSetter - stash setter for Catalyst
package MyApp;
use Catalyst qw/StashSetter/;
package MyApp::C::MyController;
sub my_action : Local {
my ( $self, $c ) = @_;
...
$c->set_stash(
template => 'my_action.html',
param1 => 'hoge',
param2 => 'foo',
param3 => 'bar',
);
}
This module provides context with stash-setter.
$c->set_stash( param => 'value' );
# you can also set multiple parameters at a time.
$c->set_stash(
param1 => 'value1',
param2 => 'value2',
param3 => 'value3',
);
This is but a synonym of follows.
$c->stash->{param1} = 'value1';
$c->stash->{param2} = 'value2';
$c->stash->{param3} = 'value3';
Repeating ``$c->stash->'' many times isn't DRY.
Lyo Kato, <lyo.kato@gmail.com>
Copyright (C) 2005 by Lyo Kato
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
Catalyst::Plugin::StashSetter - stash setter for Catalyst |