File: PluginWithTemplate.pm

package info (click to toggle)
libmojolicious-perl 9.31%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,260 kB
  • sloc: perl: 10,139; makefile: 31; javascript: 1
file content (15 lines) | stat: -rw-r--r-- 353 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package PluginWithTemplate;
use Mojo::Base 'Mojolicious::Plugin';

sub register {
  my ($self, $app) = @_;
  push @{$app->renderer->classes}, __PACKAGE__;
  $app->routes->any('/plugin_with_template')->to(cb => sub { shift->render('plugin_with_template') });
}

1;
__DATA__

@@ plugin_with_template.html.ep
% layout 'plugin_with_template';
with template