NAME
Blosxom::Plugin - Base class for Blosxom plugins
SYNOPSIS
package foo;
use strict;
use warnings;
use parent 'Blosxom::Plugin';
__PACKAGE__->load_plugin( 'DataSection' );
sub start { !$blosxom::static_entries }
sub last {
my $class = shift;
$class->response->status( 304 );
my $path_info = $class->request->path_info;
my $month = $class->util->num2month( 7 ); # Jul
my $template = $class->data_section->get( 'foo.html' );
my $interpolated = $class->interpolate( $template );
my $component = $class->get_template( 'component' );
}
1;
__DATA__
@@ foo.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Foo</title>
</head>
<body>
<h1>hello, world</h1>
</body>
</html>
DESCRIPTION
Base class for Blosxom plugins. Inspired by Blosxom 3 which was abandoned to be released.
METHODS
- $interpolated = $class->interpolte( $template )
-
A shorcut for
$interpolated = $blosxom::interpolate->( $template );
- $template = $class->get_template
-
A shortcut for
$template = $blosxom::template->( $blosxom::path_info, $class, $blosxom::flavour, );
- $template = $class->get_template( $component )
-
A shortcut for
$template = $blosxom::template->( $blosxom::path_info, $component, $blosxom::flavour, );
- $template = $class->get_template(path=>$p, component=>$c, flavour=>$f)
-
A shortcut for
$template = $blosxom::template->( $p, $c, $f )
- response, res
-
Returns a Blosxom::Plugin::Response object.
- request, req
-
Returns a Blosxom::Plugin::Request object.
- util
-
Returns a Blosxom::Plugin::Util object.
- load_plugin( $plugin )
- load_plugins( @plugins )
- add_method( $method => $coderef )
DEPENDENCIES
Blosxom 2.0.0 or higher.
SEE ALSO
ACKNOWLEDGEMENT
Blosxom was originally written by Rael Dohnfest. The Blosxom Development Team succeeded to the maintenance.
BUGS AND LIMITATIONS
This module is beta state. API may change without notice.
AUTHOR
Ryo Anazawa <anazawa@cpan.org>
LICENSE AND COPYRIGHT
Copyright (c) 2012 Ryo Anzawa. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.