1Module::Starter::PluginU:s:eTremCpolnattrei(b3u)ted PerlMoDdoucluem:e:nSttaatritoenr::Plugin::Template(3)
2
3
4
6 Module::Starter::Plugin::Template - module starter with templates
7
9 Version 0.02
10
11 $Id: Template.pm 30 2005-08-20 04:00:44Z andy $
12
14 use Module::Starter qw(
15 Module::Starter::Simple
16 Module::Starter::Plugin::Template
17 );
18
19 Module::Starter->create_distro(%args);
20
22 This plugin is designed to be added to a Module::Starter::Simple-com‐
23 patible Module::Starter class. It adds stub methods for template
24 retrieval and rendering, and it replaces all of Simple's _guts methods
25 with methods that will retrieve and render the apropriate templates.
26
28 "new(%args)"
29
30 This plugin calls the "new" supermethod and then initializes the tem‐
31 plate store and renderer. (See "templates" and "renderer" below.)
32
34 "templates()"
35
36 This method is used to initialize the template store on the Mod‐
37 ule::Starter object. It returns a hash of templates; each key is a
38 filename and each value is the body of the template. The filename
39 "Module.pm" is used for the module template.
40
41 "renderer()"
42
43 This method is used to initialize the template renderer. Its result is
44 stored in the object's "renderer" entry. The implementation will
45 determine its use.
46
47 "render($template, \%options)"
48
49 The "render" method will render the template passed to it, using the
50 data in the Module::Starter object and in the hash of passed parame‐
51 ters.
52
53 _guts methods
54
55 All of the "FILE_guts" methods from Module::Starter::Simple are sub‐
56 classed to look something like this:
57
58 sub file_guts {
59 my $self = shift;
60 my %options;
61 @options{qw(first second third)} = @_;
62
63 my $template = $self->{templates}{filename};
64 $self->render($template, \%options);
65 }
66
67 These methods will need to be rewritten when (as is likely) Mod‐
68 ule::Starter::Simple's _guts methods are refactored into a registry.
69
70 module_guts
71 Makefile_PL_guts
72 Build_PL_guts
73 Changes_guts
74 README_guts
75 t_guts
76 MANIFEST_guts
77 item cvsignore_guts
78
80 Ricardo SIGNES, "<rjbs at cpan.org>"
81
83 Please report any bugs or feature requests to "bug-module-starter at
84 rt.cpan.org", or through the web interface at <http://rt.cpan.org>. I
85 will be notified, and then you'll automatically be notified of progress
86 on your bug as I make changes.
87
89 Copyright 2005 Ricardo SIGNES, All Rights Reserved.
90
91 This program is free software; you can redistribute it and/or modify it
92 under the same terms as Perl itself.
93
94
95
96perl v5.8.8 2005-11-0M9odule::Starter::Plugin::Template(3)