Zoffix Znet > App-ZofCMS-0.0211 > App::ZofCMS::Plugin

Download:
App-ZofCMS-0.0211.tar.gz

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: App-ZofCMS-0.0221

NAME ^

App::ZofCMS::Plugin - documentation for ZofCMS plugin authors

SYNOPSYS ^

    package App::ZofCMS::Plugins::QueryToTemplate;

    use strict;
    use warnings;

    sub new { bless {}, shift; }

    sub process {
        my ( $self, $template, $query, $config ) = @_;
        
        keys %$query;
        while ( my ( $key, $value ) = each %$query ) {
            $template->{t}{"query_$key"} = $value;
        }
        
        return;
    }

    1;
    __END__

    PLEASE INCLUDE DECENT PLUGIN DOCUMENTATION

DESCRIPTION ^

This documentation is intended for ZofCMS plugin authors, whether you are coding a plugin for personal use or planning to upload to CPAN. Uploads are more than welcome.

First of all, the plugin must be located in App::ZofCMS::Plugin:: namespace.

At the very least the plugin must contain to subs:

    sub new { bless {}, shift }

This is a constructor, you don't have to use a hashref for the object but it's recommended. Currently no arguments (except a class name) are passed to new() but that may be changed in the future.

Second required sub is sub process {} the @_ will contain the following (in this order):

    $self     -- object of your plugin
    $template -- hashref which is ZofCMS template, go nuts
    $query    -- hashref containing query parameters as keys/values
    $config   -- App::ZofCMS::Config object, from here you can obtain
                 a CGI object via C<cgi()> method.

Return value is discarded.

Normally a plugin would take user input from ZofCMS template hashref. If you are using anything outside the d key (as described in App::ZofCMS::Template please delete() the key from ZofCMS template.

AUTHOR ^

Zoffix Znet, <zoffix at cpan.org> (http://zoffix.com, http://haslayout.net)

BUGS ^

Please report any bugs or feature requests to bug-app-zofcms at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-ZofCMS. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc App::ZofCMS

You can also look for information at:

COPYRIGHT & LICENSE ^

Copyright 2008 Zoffix Znet, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.