| 1 | package Mojolicious::Plugin::TypeModel; | ||
| 2 | |||
| 3 | 1 | ▶ | use Mojo::Base 'Mojolicious::Plugin'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | sub register { |
|
Subroutine
register: called CC=2 SCAR=6.9
Pod
documented
| |||
| 6 | 1 | my ($plugin, $app, $conf) = @_; | |
| 7 | 1 | my $base = $conf->{base}; | |
| 8 | 1 | my $types = $base->types; | |
| 9 | |||
| 10 | # model aliases | ||
| 11 | 1 | for my $type (keys %$types) { | |
| 12 | 1 | ▶ | $app->helper("model.$type" => sub { shift; $base->model($type => @_) }); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 13 | } | ||
| 14 | } | ||
| 15 | |||
| 16 | 1 | 1; | |
| 17 | |||