1 package Catalyst::Utils;
8 Catalyst::Utils - The Catalyst Utils
22 Returns attributes for coderef in a arrayref
26 sub attrs { attributes::get( $_[0] ) || [] }
28 =item prefix($class, $name);
30 Returns a prefixed action.
35 my ( $class, $name ) = @_;
36 my $prefix = &class2prefix($class);
37 $name = "$prefix/$name" if $prefix;
41 =item class2classprefix($class);
43 Returns the classprefix for class.
47 sub class2classprefix {
48 my $class = shift || '';
50 if ( $class =~ /^(.*::[MVC]|Model|View|Controller)?::.*$/ ) {
56 =item class2prefix($class);
58 Returns the prefix for class.
63 my $class = shift || '';
65 if ( $class =~ /^.*::([MVC]|Model|View|Controller)?::(.*)$/ ) {
67 $prefix =~ s/\:\:/\//g;
76 Sebastian Riedel, C<sri@cpan.org>
80 This program is free software, you can redistribute it and/or modify it under
81 the same terms as Perl itself.