package App::ZofCMS::Plugin::QueryToTemplate; use warnings; use strict; our $VERSION = '0.0102'; 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__ =head1 NAME App::ZofCMS::Plugin::QueryToTemplate - ZofCMS plugin to automagically make query parameters available in the template =head1 SYNOPSIS In your ZofCMS template, or in your main config file (under C or C): plugins => [ qw/QueryToTemplate/ ]; In any of your L templates: =head1 DESCRIPTION Plugin can be run at any priority level and it does not take any input from ZofCMS template. Upon plugin's execution it will stuff the C<{t}> first level key (see L if you don't know what that key is) with all the query parameters as keys and values being the parameter values. Each query parameter key will be prefixed with C. In other words, if your query looks like this: http://foo.com/index.pl?foo=bar&baz=beerz In your template parameter C would be accessible as C and parameter C would be accessible via C Foo is: Baz is: =head1 AUTHOR Zoffix Znet, C<< >> (L, L) =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT You can find documentation for this module with the perldoc command. perldoc App::ZofCMS::Plugin::QueryToTemplate You can also look for information at: =over 4 =item * RT: CPAN's request tracker L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =item * Search CPAN L =back =head1 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. =cut