23 Mar
2012
23 Mar
'12
3:39 p.m.
----- Original Message -----
From: Alexis Sukrieh <sukria@sukria.net>
I'll do it that way:
In the plugin:
register 'before_hook_for_prefix' => sub { my ($prefix) = @_;
hook 'before' => sub { if (request->path =~ /^$prefix/) { .... } }; };
And in the app:
use MyPlugin;
before_hook_for_prefix '/companies';
See the idea?
Of course, that's one way, there must be many others.
Works like a charm and tests pass with flying colors. Thanks! Cheers, Ovid -- Live and work overseas - http://overseas-exile.blogspot.com/ Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog - http://blogs.perl.org/users/ovid/ Twitter - http://twitter.com/OvidPerl/