CatalystX-ActionBuilders
view release on metacpan or search on metacpan
lib/CatalystX/ActionBuilders.pm view on Meta::CPAN
7475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
navigation
=> [
':default'
,
(
map
{
"menu_$_"
}
qw{ label parent args cond order roles title }
),
],
action_role
=> [
qw{ does }
],
simple_login
=> [
qw{ needs_login }
],
},
};
sub
index_parts() { (path_name(
q{}
), args(0)) }
sub
action(&) {
return
shift
}
# experimental - beore/after wrappers for our action method
sub
before_action(&) { (
_before
=>
$_
[0] ) }
sub
after_action(&) { (
_after
=>
$_
[0] ) }
#sub template($) { my $t = shift; (_before => sub { $_[1]->stash-> { template} = $t }) }
sub
tweak_stash($$) {
my
(
$k
,
$v
) =
@_
; (
_before
=>
sub
{
$_
[1]->stash-> {
$k
} =
$v
}) }
sub
template($) { tweak_stash(
template
=>
$_
[0]) }
# standard atts
sub
chained($) { _att(
Chained
=>
@_
) }
sub
args($) { _att(
Args
=>
@_
) }
sub
capture_args($) { _att(
CaptureArgs
=>
@_
) }
sub
path_part($) { _att(
PathPart
=>
@_
) }
sub
path_name($) { _att(
Path
=>
@_
) }
sub
action_class($) { _att(
ActionClass
=>
@_
) }
# Catalyst::Plugin::Navigation specific bits
sub
menu_label($) { _att(
Menu
=>
@_
) }
sub
menu_parent($) { _att(
MenuParent
=>
@_
) }
sub
menu_args($) { _att(
MenuArgs
=>
@_
) }
sub
menu_cond($) { _att(
MenuCond
=>
@_
) }
sub
menu_order($) { _att(
MenuOrder
=>
@_
) }
sub
menu_roles($) { _att(
MenuRoles
=>
@_
) }
sub
menu_title($) { _att(
MenuTitle
=>
@_
) }
# Catalyst::Plugin::ActionRole
sub
does($) { _att(
Does
=>
@_
) }
# CatalystX::SimpleLogin
sub
needs_login() { does
'NeedsLogin'
}
sub
_att { (
shift
(
@_
) => [
@_
] ) }
# XXX
my
%counter
= ();
sub
_add_path {
my
(
$path
,
$meta
,
$name
,
@args
) =
@_
;
my
$sub
=
pop
@args
;
( run in 0.284 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )