| App-TemplateServer documentation | Contained in the App-TemplateServer distribution. |
App::TemplateServer::Provider::Null - a test template provider
This doesn't do anything useful. It's just example code for you to poke at.
Try it out like this:
template-server --provider Null --data /path/to/some/yaml
Then visit http://localhost:4000/test and you can see the YAML.
Both implemented as App::TemplateServer::Provider suggests.
| App-TemplateServer documentation | Contained in the App-TemplateServer distribution. |
package App::TemplateServer::Provider::Null; use Moose; use Method::Signatures; use YAML::Syck; with 'App::TemplateServer::Provider'; method list_templates { return qw/this is a test/; }; method render_template($template, $context){ my $data = Dump({%$context, docroot => [$self->docroot]}); $data =~ s/&/&/g; $data =~ s/</</g; $data =~ s/>/>/g; my $res = "<p>This is a template called $template</p>"; $res .= "<p>Here is all the data I know about:<br />"; $res .= "<blockquote><pre>$data</pre></blockquote></p>"; return $res; }; 1; __END__