line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Spark::Form::Field::Role::Printable::HTML; |
2
|
|
|
|
|
|
|
our $VERSION = '0.2102'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: a HTML4-printable form field role |
6
|
|
|
|
|
|
|
|
7
|
14
|
|
|
14
|
|
9172
|
use Moose::Role; |
|
14
|
|
|
|
|
22
|
|
|
14
|
|
|
|
|
124
|
|
8
|
|
|
|
|
|
|
with 'Spark::Form::Field::Role::Printable'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires 'to_html'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=pod |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 NAME |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Spark::Form::Field::Role::Printable::HTML - a HTML4-printable form field role |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 VERSION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
version 0.2102 |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 SYNOPSIS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
package MyApp::Form::Field::CustomText; |
29
|
|
|
|
|
|
|
use Moose; |
30
|
|
|
|
|
|
|
extends 'Spark::Form::Field'; |
31
|
|
|
|
|
|
|
with 'Spark::Form::Field::Role::Printable::HTML'; |
32
|
|
|
|
|
|
|
use HTML::Tiny; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub to_html { |
35
|
|
|
|
|
|
|
my ($self) = @_; |
36
|
|
|
|
|
|
|
my $html = HTML::Tiny->new( mode => 'html' ); |
37
|
|
|
|
|
|
|
$html->input({type => 'text', value => $self->value}); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 to_html :: Undef => Str |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This function should return a HTML string representing your control |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SEE ALSO |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=over 4 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item L<Spark::Form::Field> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=back |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 AUTHOR |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
James Laver L<http://jameslaver.com> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This software is copyright (c) 2009 by James Laver C<< <sprintf qw(%s@%s.%s cpan jameslaver com)> >>. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
65
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |
72
|
|
|
|
|
|
|
|