summaryrefslogtreecommitdiff
path: root/lib/Tree/Template/Declare.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Tree/Template/Declare.pm')
-rw-r--r--lib/Tree/Template/Declare.pm24
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/Tree/Template/Declare.pm b/lib/Tree/Template/Declare.pm
index 1c4a53a..118fcea 100644
--- a/lib/Tree/Template/Declare.pm
+++ b/lib/Tree/Template/Declare.pm
@@ -80,7 +80,7 @@ sub _build_group {
},
};
if ($builder->can('_munge_exports')) {
- return $builder->_munge_exports($normal_exports);
+ return $builder->_munge_exports($normal_exports,\@current_node);
}
else {
return $normal_exports;
@@ -207,10 +207,24 @@ adds the second node at the end of the children list of the first node
=back
The builder can also implement an C<_munge_exports> method. If it
-does, C<_munge_exports> will be called with a hash ref consisting of
-the methods that C<Tree::Template::Declare> wants to export, and it
-should return a hash ref with the methods that will actually be
-exported.
+does, C<_munge_exports> will be called with:
+
+=over 4
+
+=item *
+
+a hash ref consisting of the functions that C<Tree::Template::Declare>
+wants to export,
+
+=item *
+
+an array ref, whose first element will be the current node whenever
+the user calls an exported function
+
+=back
+
+C<_munge_exports> should return a hash ref with the functions that
+will actually be exported.
See L<Sub::Exporter>, in particular the section on group builders, for
details. See L<Tree::Template::Declare::HTML_Element> and