| 1 | package Galileo::Plugin::Modal; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use Mojo::Base 'Mojolicious::Plugin'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 3 | ▶ | sub register { | ||||||||
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 6 | 3 | my ($plugin, $app) = @_; | |||||||||
| 7 | |||||||||||
| 8 | 3 | push @{$app->renderer->classes}, __PACKAGE__; | |||||||||
| 9 | |||||||||||
| 10 | 37 | ▶ | $app->helper( modal => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
| |||||||||||
| 11 | 37 | my ($self, $id, $body) = @_; | |||||||||
| 12 | 37 | ▶ | $body = $body->() if ref $body; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 37 | return $self->render_to_string( | |||||||||
| 14 | template => 'galileo_modal', | ||||||||||
| 15 | 'galileo.modal.id' => $id, | ||||||||||
| 16 | 'galileo.modal.body' => $body, | ||||||||||
| 17 | ); | ||||||||||
| 18 | 3 | }); | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 3 | 1; | |||||||||
| 22 | |||||||||||
| 23 | __DATA__ | ||||||||||