Skip to content

Instantly share code, notes, and snippets.

@yappo
Created September 9, 2013 09:41
Show Gist options
  • Save yappo/6493541 to your computer and use it in GitHub Desktop.
Save yappo/6493541 to your computer and use it in GitHub Desktop.
[% KSGK_CONTENTS 'daigorou' %]
sub wine {
}
[% END %]
package View;
use strict;
use warnings;
use Text::Xslate;
my $tx = Text::Xslate->new(
function => {
KSGK_CONTENTS => sub {
my $name = shift; # ここに omaeno.tt のなかの KSGK_CONTENTS 'daigorou' の daigorou がはいる
my $text = shift; # ここに omaeno.tt のなかの KSGK_CONTENTS のブロックの中身がくる
}
}
);
$tx->rendar('omaeno.tt');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment