Made it more modern

This commit is contained in:
vti committed 2010-06-15 12:27:12 +02:00
1 parent a2ce996b97
commit 96d2be17b4
8 files changed
+223 -72

No files matched your search

+57
View File
@@ -0,0 +1,57 @@
package Mojolicious::Plugin::TtRenderer;
use strict;
use warnings;
use base 'Mojolicious::Plugin';
use MojoX::Renderer::TT;
sub register {
my ($self, $app, $args) = @_;
$args ||= {};
my $tt = MojoX::Renderer::TT->build(%$args, mojo => $app);
# Add "tt" handler
$app->renderer->add_handler(tt => $tt);
}
1;
__END__
=head1 NAME
Mojolicious::Plugin::TtRenderer - Template Renderer Plugin
=head1 SYNOPSIS
# Mojolicious
$self->plugin('tt_renderer');
$self->plugin(tt_renderer => {FILTERS => [ ... ]});
# Mojolicious::Lite
plugin 'tt_renderer';
plugin tt_renderer => {FILTERS => [ ... ]};
=head1 DESCRIPTION
L<Mojolicous::Plugin::TtRenderer> is a simple loader for L<MojoX::Renderer::TT>.
=head1 METHODS
L<Mojolicious::Plugin::TtRenderer> inherits all methods from
L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
$plugin->register;
Register renderer in L<Mojolicious> application.
=head1 SEE ALSO
L<MojoX::Renderer::TT>, L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicious.org>.
=cut