Now that we now the API we need to write a handler. The following is an example skeleton of a valid template handler. Template handlers are very simple to write. They inherit from the:
lib::common::template_handler
super class. They also need only one method and no package data. You can of course have more if you wish but BrickLayer doesn't need anything else to run your handler.
package default;
use lib::common::template_handler;
use base qw(template_handler);
sub run {
my $self = shift;
my $Params = shift;
return "wheeee!!!! I handled a template tag";
}
return 1;
The run method is required and will be passed one argument which will be an array of any parameters that bricklayer has for your handler.
Jeremy Wall
2006-08-21