| 1 | package Statocles::Plugin; | ||
| 2 | 10 | our $VERSION = '0.099'; | |
| 3 | # ABSTRACT: Base role for Statocles plugins | ||
| 4 | |||
| 5 | #pod =head1 SYNOPSIS | ||
| 6 | #pod | ||
| 7 | #pod # lib/My/Plugin.pm | ||
| 8 | #pod package My::Plugin; | ||
| 9 | #pod use Moo; # or Moose | ||
| 10 | #pod with 'Statocles::Plugin'; | ||
| 11 | #pod | ||
| 12 | #pod sub register { | ||
| 13 | #pod my ( $self, $site ) = @_; | ||
| 14 | #pod # Register things like event handlers and theme helpers | ||
| 15 | #pod } | ||
| 16 | #pod | ||
| 17 | #pod 1; | ||
| 18 | #pod | ||
| 19 | #pod # site.yml | ||
| 20 | #pod site: | ||
| 21 | #pod args: | ||
| 22 | #pod plugins: | ||
| 23 | #pod name: | ||
| 24 | #pod $class: My::Plugin | ||
| 25 | #pod | ||
| 26 | #pod =head1 DESCRIPTION | ||
| 27 | #pod | ||
| 28 | #pod Statocles Plugins are attached to sites and add features such as template helpers | ||
| 29 | #pod and event handlers. | ||
| 30 | #pod | ||
| 31 | #pod This is the base role that all plugins should consume. | ||
| 32 | #pod | ||
| 33 | #pod =cut | ||
| 34 | |||
| 35 | 10 | ▶ | use Statocles::Base 'Role'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 36 | |||
| 37 | #pod =method register | ||
| 38 | #pod | ||
| 39 | #pod $plugin->register( $site ); | ||
| 40 | #pod | ||
| 41 | #pod Register this plugin with the given L<Statocles::Site | ||
| 42 | #pod object|Statocles::Site>. This is called automatically when the site is | ||
| 43 | #pod created. | ||
| 44 | #pod | ||
| 45 | #pod =cut | ||
| 46 | |||
| 47 | 10 | requires 'register'; | |
| 48 | |||
| 49 | 10 | 1; | |
| 50 | |||
| 51 | __END__ | ||