1 package Catalyst::AttrContainer;
4 use Catalyst::Exception;
5 with 'Catalyst::ClassData';
9 __PACKAGE__->mk_classdata(_attr_cache => {} );
10 __PACKAGE__->mk_classdata( _action_cache => [] );
12 # note - see attributes(3pm)
13 sub MODIFY_CODE_ATTRIBUTES {
14 my ( $class, $code, @attrs ) = @_;
15 $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } );
16 $class->_action_cache(
17 [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] );
21 sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () }
25 Catalyst::AttrContainer - Handles code attribute storage and caching
31 This class sets up the code attribute cache. It's a base class for
32 L<Catalyst::Controller>.
36 =head2 FETCH_CODE_ATTRIBUTES
38 Attribute function. See attributes(3pm)
40 =head2 MODIFY_CODE_ATTRIBUTES
42 Attribute function. See attributes(3pm)
46 L<Catalyst::Dispatcher>
51 Catalyst Contributors, see Catalyst.pm
55 This program is free software, you can redistribute it and/or modify it under
56 the same terms as Perl itself.