File Coverage

blib/lib/Spark/Form/Field/Role/Printable/XHTML.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Spark::Form::Field::Role::Printable::XHTML;
2             our $VERSION = '0.2102';
3              
4              
5             # ABSTRACT: a XHTML1-printable form field role
6              
7 14     14   7505 use Moose::Role;
  14         20  
  14         90  
8             with 'Spark::Form::Field::Role::Printable';
9              
10             requires 'to_xhtml';
11              
12             1;
13              
14              
15              
16             =pod
17              
18             =head1 NAME
19              
20             Spark::Form::Field::Role::Printable::XHTML - a XHTML1-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::XHTML';
32             use HTML::Tiny;
33              
34             sub to_xhtml {
35             my ($self) = @_;
36             my $html = HTML::Tiny->new( mode => 'xml' );
37             $html->input({type => 'text', value => $self->value});
38             }
39              
40             =head1 METHODS
41              
42             =head2 to_xhtml :: Undef => Str
43              
44             This function should return a XHTML 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