Next:
Yawns::Formatters::BBCode
Previous:
Yawns::Date
 [Table of Contents]

Yawns::Formatters



NAME

Yawns::Formatters - A helper module for formatting user Text comments.

SYNOPSIS

    #!/usr/bin/perl -w

    use Yawns::Formatters;
    use strict;

    # Get the list of available formatters.
    my $factory   = Yawns::Formatters->new;
    my %installed = $factory->getAvailable();

    # Create a new BBCode formatter.
    my $bbcode = $factory->create( "bbcode", "text to be formated" );

DESCRIPTION

This module allows the site to dynamically determine which formatting modules are available, and to create instances of each one.

It is a simple factory pattern, albeit a hard-wired one rather than a dynamic one.

new

  Constructor, not really used for much.

getAvailable

  Return the formatting types which are available.

create

  Create an instance of the correct type - this is the factory part
 of the code.

AUTHOR

Steve Kemp

http://www.steve.org.uk/

LICENSE

Copyright (c) 2007 by Steve Kemp. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.


[Top] Generated by HTML::FromPod 0.49 on Fri Nov 21 03:03:57 2008