App::ZofCMS::Plugin - documentation for ZofCMS plugin authors
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
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.
new()
Second required sub is sub process {} the @_ will contain the following (in this order):
sub process {}
@_
$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.
d
delete()
Fork this module on GitHub: https://github.com/zoffixznet/App-ZofCMS
To report bugs or request features, please use https://github.com/zoffixznet/App-ZofCMS/issues
If you can't access GitHub, you can email your request to bug-App-ZofCMS at rt.cpan.org
bug-App-ZofCMS at rt.cpan.org
Zoffix Znet <zoffix at cpan.org> (http://zoffix.com/, http://haslayout.net/)
You can use and distribute this module under the same terms as Perl itself. See the LICENSE file included in this distribution for complete details.
LICENSE
To install App::ZofCMS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::ZofCMS
CPAN shell
perl -MCPAN -e shell install App::ZofCMS
For more information on module installation, please visit the detailed CPAN module installation guide.