Ticket #374 (feature)

Opened 13 years ago

Last modified 13 years ago

allow sub load :Hook('subscription.load') in plugins

Status: new

Reported by: miyagawa Assigned to: miyagawa
Priority: major Milestone:
Component: Plagger Version:
Keywords: Cc:

easier way to write plugins rather than copy-pasting register_hook() every time, you could write:

package Plagger::Plugin::Subscription::Foo;
use strict;
use base qw( Plagger::Plugin );

sub load :Hook('subscription.load') {


hook-attr.patch (2.0 kB) - added by miyagawa on 08/16/06 06:34:47.

Change History

08/16/06 06:34:47: Modified by miyagawa

  • attachment hook-attr.patch added.

08/16/06 06:36:14: Modified by miyagawa

There's still problems with inheritance and register_hook() ordering. It'd be cool to add Rule as an attribute too.

The patch is backward compatible, so existing register_hook() works perfect. I'm not sure if it's a good thing to have 2 different ways to do the same thing. Maybe it's not.