% layout 'default', title => $self->boardName;
<% my $catHeader = begin %>
% my $_catID = shift; my $_name = shift;
<% end %>
<% my $subfItem = begin %>
% my $_subfID = shift; my $_catID = shift;
% my $_name = shift;
<%= $_name %>
<% end %>
<%
foreach my $category ($categoryTree->getAllChildren) { %>
<%= $catHeader->(
$category->getNodeValue,
$self->schema->resultset('Categories')->
title_from_id($category->getNodeValue)) %>
<% say ('$category: ' . $category); %>
<%
foreach my $subforum ($category->getAllChildren) { %>
<%= $subfItem->(
$subforum->getNodeValue,
$category->getNodeValue,
$self->schema->resultset('Subforums')->
title_from_id($subforum->getNodeValue)) %>
<% }} %>