Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users
Action attributes
 

Index | Next | Previous | View Flat


forihrd at gmail

Jun 5, 2009, 8:35 PM


Views: 504
Permalink
Action attributes

Hi there,
we use Catalyst about year and one thing make a lot of pain. When you
make typo in action attribute name Catalyst silently eat it. For
example:

sub foo : Loacal Arg(1) {

}

will be work, but Arg(1) just do nothing.

Now we use few additional attributes and I add trivial check in
Our::Catalyst::Action:

my @correct_names = qw<
Path
Private
Global
Local
Regex
LocalRexgex
Args
Chained
CaptureArgs
PathPart

Method
Secure
UnSecure
RestrictTo
Crumb
Test
>;

foreach my $name (keys %$attrs) {
unless ( first { $name eq $_ } @correct_names ) {
die "Wrong trait (attribute) $name!";
}
}

so it is work for us, but mb better to add something like this in
Catalyst itself? I can make patch if this helps.

Excuse my ugly English, plz.

Ilya

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Subject User Time
Action attributes forihrd at gmail Jun 5, 2009, 8:35 PM
    Re: Action attributes bobtfish at bobtfish Jun 6, 2009, 9:36 AM
    Re: Action attributes dbix-class at trout Jun 8, 2009, 12:07 PM
        Re: Action attributes forihrd at gmail Jun 14, 2009, 12:55 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.