NAME
Nephia::MetaTemplate - Meta Template Processor for Nephia::Setup flavors
SYNOPSIS
A template in your flavor.
<html>
<head>
<title>[= title =]</title>
</head>
</html>
<body>
<h1>Access to value: [= title =]</h1>
<h2>Access to nested value: [= author.name =]</h2>
</body>
</html>
And, in your flavor class.
my $meta_template = '<html>...'; # meta template string
my $mt = Nephia::MetaTemplate->new(
tag => '{{ ... }}',
arrow => '@',
argument => 'val:...',
replace_table => [
qr|</body>| => '</body><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>',
],
);
my $template = $mt->process($meta_template);
Then, $template is like as following.
<html>
<head>
<title>{{ val:title }}</title>
</head>
</html>
<body>
<h1>Access to value: {{ val:title }}</h1>
<h2>Access to nested value: {{ val:author@name }}</h2>
</body><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</html>
DESCRIPTION
Nephia::MetaTemplate is a Meta-Template Processor for helping you make your own nephia flavor.
AUTHOR
ytnobody
<ytnobody@gmail.com>