# $Id: IfParam.pm,v 1.1.1.1 2001/06/07 15:40:36 matt Exp $ package AxKit::XSP::IfParam; use strict; use Apache::AxKit::Language::XSP; use vars qw/@ISA $NS $VERSION/; @ISA = ('Apache::AxKit::Language::XSP'); $NS = 'http://axkit.org/NS/xsp/if-param/v1'; $VERSION = "1.4"; sub parse_start { my ($e, $tag) = @_; $e->manage_text(0); return 'if ($cgi->param(q|' . $tag . '|)) {'; } sub parse_end { # compat only return '}'; } 1; __END__ =head1 NAME AxKit::XSP::IfParam - Equivalent of XSP Param taglib, but conditional. =head1 SYNOPSIS Add the taglib to AxKit (via httpd.conf or .htaccess): AxAddXSPTaglib AxKit::XSP::IfParam Add the C namespace to your XSP C<> tag: Then use the tags: Someone sent a foo param! Value was: =head1 DESCRIPTION This library is almost exactly the same as the XSP param taglib, except it gives conditional sections based on parameters. So rather than having to say: if () { ... } You can just say: ... Which makes life much easier. =head1 AUTHOR Matt Sergeant, matt@axkit.com =head1 LICENSE This software is Copyright 2001 AxKit.com Ltd. You may use or redistribute this software under the same terms as Perl itself.