Skip to content

Instantly share code, notes, and snippets.

View MadMartigan's full-sized avatar

Marty Tennison MadMartigan

View GitHub Profile
@MadMartigan
MadMartigan / partial
Created October 17, 2011 17:03
One way to display a partially rendered template
#!/usr/bin/env perl
use Mojolicious::Lite;
# Documentation browser under "/perldoc"
plugin 'PODRenderer';
get '/welcome' => sub {
my $self = shift;
my $guide = $self->render('guide', partial => 1);
$self->render(
$self->redirect_to('/', foo => 'bar');
% if ( defined stash('foo') ) {
<%== stash 'foo' %>
% }