use strict; package HTML::FormFu::Plugin; $HTML::FormFu::Plugin::VERSION = '2.07'; # ABSTRACT: base class for plugins use Moose; use MooseX::Attribute::Chained; with 'HTML::FormFu::Role::HasParent', 'HTML::FormFu::Role::Populate'; use HTML::FormFu::ObjectUtil qw( form parent ); has type => ( is => 'rw', traits => ['Chained'] ); sub pre_process { } sub process { } sub post_process { } sub render { } sub post_render { } sub clone { my ($self) = @_; my %new = %$self; return bless \%new, ref $self; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME HTML::FormFu::Plugin - base class for plugins =head1 VERSION version 2.07 =head2 DESCRIPTION Plugins can be added to a form or any element to modify their behaviour. Some plugins should only be added to either a form, or an element, depending on their design. =head1 METHODS Plugins can override any of the following method stubs. =head2 process Only plugins added to a form or a field element inheriting from L will have their C method run. For form plugins, is called during L, before C is called on any elements. For field plugins, is called during the field's C call. =head2 pre_process For form plugins, is called immediately after C is run on the elements. For element plugins, is called before C is run on form plugins. =head2 post_process For form plugins, is called immediately before L returns. For element plugins, is called before C is run on form plugins. =head2 render Only plugins added to a form will have their C method run. Is called during L before the L is called. =head2 post_render Only plugins added to a form will have their C method run. Is called during L immediately before L return. Is passed a reference to the return value of L. =head1 CORE PLUGINS =over =item L =back =head1 AUTHOR Carl Franks, C =head1 LICENSE This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR Carl Franks =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018 by Carl Franks. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut