Skip to content

Instantly share code, notes, and snippets.

@sharifulin
Created March 17, 2010 18:44
Show Gist options
  • Save sharifulin/335581 to your computer and use it in GitHub Desktop.
Save sharifulin/335581 to your computer and use it in GitHub Desktop.
Example template with virtual block in a Mojolicious
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => 'index_with_block';
shagadelic;
__DATA__
@@ index.html.ep
<p><a href="/">Index</a></p>
bla bla bla
<p><a href="/">Index</a></p>
bla2 bla2 bla2
<p><a href="/">Index</a></p>
@@ index_with_block.html.ep
<%{ content 'link' => %><p><a href="/">Index</a></p><%}%>
%= content 'link'
bla bla bla
%= content 'link'
bla2 bla2 bla2
%= content 'link'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment