Skip to content

Instantly share code, notes, and snippets.

@Bocom
Forked from Kulag/gist:561709
Created September 2, 2010 02:58
Show Gist options
  • Save Bocom/561776 to your computer and use it in GitHub Desktop.
Save Bocom/561776 to your computer and use it in GitHub Desktop.
use v5.10;
use Mojolicious::Lite;
get '/' => sub {
shift->render(layout => 'page', text => 'hello world!', title => 'test');
};
get '/index' => 'index';
app->start;
__DATA__
@@ layouts/page.html.ep
<!doctype html><html>
<head>
<title><%= $title %> | BooruSagashi</title>
</head>
<body><%= content %></body>
</html>
@@ index.html.ep
% layout 'page', title => 'test';
blah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment