MooseX-Role-BuildInstanceOf
view release on metacpan or search on metacpan
t/share/templates.txt view on Meta::CPAN
content forth_block_content {
$content;
}
}
p fifth_block {
while($self->paragraphs) {
$p->content($self->shift_paragraphs);
}
}
}
body mybody {
$self->paragraphs myloop(Str $paragraph) {
p {
$p->content($paragraph);
}
}
}
body mybody {
foreach my $paragraph ($self->paragraphs) {
my $p = p->content($paragraph);
$body->content($p);
}
}
$self->paragraphs {
$first { };
$even { }:
$self->add_event_handler($first) {
$self->add_class('first');
}
}
}
method do_something {
## some sort of logic
}
}
tag html {
tag body does Filter {
}
}
template NewTemplate {
extends BasicTemplate;
attribute 'paragraphs' => (isa=>ArrayRef);
overlay '//h1' {
$matched->create_or_append_attribute({class=>'ggg'});
$matched->insert_before->hr;
}
around first_dir {
t h1 {
'{This adds some stuff}
}
$self->$body;
}
overlay addsomething {
match('//h1') as fix_h1s {
$matched->create_or_append_attribute({class=>'ggg'});
$matched->insert_before->hr;
}
}
template MyApp::UI::Basic {
extends '::RootWindow';
has 'title' => ();
has 'introduction' => ();
has 'sections' => (isa=>Sections');
render_via Renderer::HTML->new(file=>'basic.html',
}
template Hello with xHTML {
has 'title' => (
isa=>Str,
requires=>1,
);
has 'scripts' => (
isa=>ArrayRef[URL],
requires=>1,
);
html {
head does Meta {
title page_title :id('sss') {
$self->title;
}
foreach my $script ($self->scripts) {
script {
$tag->url($script);
}
}
$self->scripts->script {
}
}
}
}
template Hello {
has 'title' => (
isa=>Str,
required=>1,
);
( run in 2.502 seconds using v1.01-cache-2.11-cpan-5735350b133 )