line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Lace::Utils; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
445929
|
use Exporter 'import'; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
236
|
use Template::Lace::ComponentCallback; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
99
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @EXPORT_OK = (qw/mk_component/); |
7
|
|
|
|
|
|
|
our %EXPORT_TAGS = (All => \@EXPORT_OK, ALL => \@EXPORT_OK); |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
0
|
7074
|
sub mk_component(&) { return Template::Lace::ComponentCallback->new(@_) } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
1; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Template::Lace::Utils - Utility Methods |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
TBD |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 DESCRIPTION |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
A collection of helpful utility methods |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 mk_component |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Make a callback component. See L<Template::Lace::ComponentCallback>. Example: |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
use Template::Lace::Utils 'mk_component'; |
30
|
|
|
|
|
|
|
my $factory = Template::Lace::Factory->new( |
31
|
|
|
|
|
|
|
model_class=>'Local::Template::User', |
32
|
|
|
|
|
|
|
component_handlers=>+{ |
33
|
|
|
|
|
|
|
tag => { |
34
|
|
|
|
|
|
|
anchor => mk_component { |
35
|
|
|
|
|
|
|
my ($self, %attrs) = @_; |
36
|
|
|
|
|
|
|
return "<a href='$_{href}' target='$_{target}'>$_{content}</a>"; |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
}, |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SEE ALSO |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
L<Template::Lace>. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 AUTHOR |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Please See L<Template::Lace> for authorship and contributor information. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Please see L<Template::Lace> for copyright and license information. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |