| | 132 | MooseX::Plaggerize is a Moose::Role.You can use this module with 'with'. |
| | 133 | |
| | 134 | =head1 METHOD |
| | 135 | |
| | 136 | =over 4 |
| | 137 | |
| | 138 | =item $self->load_plugin({ module => $module, config => $conf) |
| | 139 | |
| | 140 | if you write: |
| | 141 | |
| | 142 | my $app = MyApp->new; |
| | 143 | $app->load_plugin({ module => 'Foo', config => {hoge => 'fuga'}) |
| | 144 | |
| | 145 | above code executes follow code: |
| | 146 | |
| | 147 | my $app = MyApp->new; |
| | 148 | my $plugin = MyApp::Plugin::Foo->new({hoge => 'fuga'}); |
| | 149 | $plugin->register( $app ); |
| | 150 | |
| | 151 | =item $self->register_hook('hook point', $plugin, $code) |
| | 152 | |
| | 153 | register code to hook point.$plugin is instance of plugin. |
| | 154 | |
| | 155 | =item $self->run_hook('finalize', $c) |
| | 156 | |
| | 157 | run hook. |
| | 158 | |
| | 159 | use case: mostly ;-) |
| | 160 | |
| | 161 | =item $self->run_hook_first('hook point', @args) |
| | 162 | |
| | 163 | run hook. |
| | 164 | |
| | 165 | if your hook code returns true value, stop the hook loop(this feature likes OK/DECLINED of mod_perl handler). |
| | 166 | |
| | 167 | (please look source code :) |
| | 168 | |
| | 169 | use case: handler like mod_perl |
| | 170 | |
| | 171 | =item $self->run_hook_filter('hook point', @args) |
| | 172 | |
| | 173 | run hook. |
| | 174 | |
| | 175 | (please look source code :) |
| | 176 | |
| | 177 | use case: html filter |
| | 178 | |
| | 179 | =item $self->get_hook('hook point') |
| | 180 | |
| | 181 | get the codes. |
| | 182 | |
| | 183 | use case: write tricky code :-( |
| | 184 | |
| | 185 | =back |
| | 186 | |