Skip to content

Instantly share code, notes, and snippets.

@niner

niner/Root.pm Secret

Created October 30, 2016 15:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save niner/853be7c667b05ef058f30194738863b7 to your computer and use it in GitHub Desktop.
<div tal:repeat="res results">
<span tal:content="res/id"/>
<span tal:content="uri res --edit"/>
</div>
method index($c) is Path is Args(0) {
my @results = Foo.new(id => 1), Foo.new(id => 2), Bar.new(id => 3);
my proto sub uri(|) { * }
my multi sub uri(Foo $f, $action) { $c.uri_for('/foo', $f.id, $action) }
my multi sub uri(Bar $b, $action) { $c.uri_for('/bar', $b.id, $action) }
$c.stash({
template => 'index.zpt',
uri => &uri,
results => @results,
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment