| 1 | 15 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 15 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | package HTML::Widget::Plugin::Submit; | ||
| 4 | # ABSTRACT: for submit type inputs | ||
| 5 | 15 | $HTML::Widget::Plugin::Submit::VERSION = '0.204'; | |
| 6 | 15 | ▶ | use parent 'HTML::Widget::Plugin::Input'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | #pod =head1 SYNOPSIS | ||
| 9 | #pod | ||
| 10 | #pod $widget_factory->submit({ | ||
| 11 | #pod id => 'button-id', # will be used as default control name, too | ||
| 12 | #pod value => 'button label', | ||
| 13 | #pod }); | ||
| 14 | #pod | ||
| 15 | #pod =head1 DESCRIPTION | ||
| 16 | #pod | ||
| 17 | #pod This plugin provide a simple submit plugin, which returns an input element of | ||
| 18 | #pod type submit. | ||
| 19 | #pod | ||
| 20 | #pod =head1 METHODS | ||
| 21 | #pod | ||
| 22 | #pod =head2 C< provided_widgets > | ||
| 23 | #pod | ||
| 24 | #pod This plugin provides the following widgets: input | ||
| 25 | #pod | ||
| 26 | #pod =cut | ||
| 27 | |||
| 28 | 16 | ▶ | sub provided_widgets { qw(submit) } |
|
Subroutine
provided_widgets: called CC=1 SCAR=0.0
Pod
documented
| |||
| 29 | |||
| 30 | #pod =head2 C< submit > | ||
| 31 | #pod | ||
| 32 | #pod This method returns a basic submit input. | ||
| 33 | #pod | ||
| 34 | #pod In addition to the generic L<HTML::Widget::Plugin> attributes, the following | ||
| 35 | #pod are valid arguments: | ||
| 36 | #pod | ||
| 37 | #pod =over | ||
| 38 | #pod | ||
| 39 | #pod =item value | ||
| 40 | #pod | ||
| 41 | #pod This is the widget's initial value, which (for submit inputs) is generally used | ||
| 42 | #pod as the text for the label on its face. | ||
| 43 | #pod | ||
| 44 | #pod =back | ||
| 45 | #pod | ||
| 46 | #pod =cut | ||
| 47 | |||
| 48 | 15 | ▶ | use HTML::Element; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 49 | |||
| 50 | 2 | ▶ | sub submit { |
|
Subroutine
submit: called CC=1 SCAR=0.0
Pod
documented
| |||
| 51 | 2 | my ($self, $factory, $arg) = @_; | |
| 52 | |||
| 53 | 2 | $arg->{attr}{type} = 'submit'; | |
| 54 | |||
| 55 | # I suppose I could carp, here, if the type is altered, but... it's your | ||
| 56 | # foot, shoot it if you want. -- rjbs, 2007-02-28] | ||
| 57 | |||
| 58 | 2 | $self->build($factory, $arg); | |
| 59 | } | ||
| 60 | |||
| 61 | 15 | 1; | |
| 62 | |||
| 63 | __END__ | ||