package Template::Plugin::Heritable; use strict; use warnings; our $VERSION = "0.04"; use base qw(Template::Plugin); =head1 NAME Template::Plugin::Heritable - OO dispatching and inheritance for templates =head1 SYNOPSIS [% USE Heritable %] [%# searches providers for a "view" template method on class (which should be a metamodel object, eg someobj.meta in Perl 6) %] [% Heritable.include(class, "view", { self = object }) %] [%# return list of paths it would look %] [% paths = Heritable.dispatch_paths(class, "view") %] [%# if you don't have the class of the object handy, then use 'invoke' instead %] [% Heritable.invoke(object, "method", { self = object } %] [%# call the next method in the inheritance tree from inside a template method %] [% next_template() %] =head1 DESCRIPTION C provides support for selecting an appropriate template based on the class of an object. It is also possible to call the next template in the inheritance heirarchy/chain. This provides a form of inheritance for template display. The core of this is the I