NAME
AxKit::XSP::QueryParam - Advanced parameter manipulation taglib
SYNOPSIS
Add the parm: namespace to your XSP <xsp:page
> tag:
<xsp:page
language="Perl"
xmlns:xsp="http://apache.org/xsp/core/v1"
xmlns:param="http://www.axkit.org/2002/XSP/QueryParam"
>
And add this taglib to AxKit (via httpd.conf or .htaccess):
AxAddXSPTaglib AxKit::XSP::QueryParam
DESCRIPTION
AxKit::XSP::QueryParam is a taglib built around the Apache::Request module that allows you to manipulate request parameters beyond simple getting of parameter values.
Tag Reference
<param:get name="foo"/
>
Get a value from the given parameter. The "name" attribute can be passed as a child element for programattic access to parameter values.
<param:set name="foo" value="bar"/
>
Set a parameter value. You can use child elements for both "name" and "value". This is very useful when you want to override the parameters provided by the userr.
<param:remove name="foo"/
>
Remove a parameter. Surprisingly enough, you can use child elements here as well. Are you beginning to notice a pattern?
<param:exists name="foo"/
>
Returns a boolean value representing whether the named parameter exists, even if it has an empty or false value. You can use child...oh, nevermind, you get the idea.
<param:enumerate/
>
Returns an enumerated list of the parameter names present. Now, you would think that you can use child elements here, but you can't! Ha, fooled you! This doesn't take any parameters, since it dumps the contents of the entire parameter list to a structured element. It outputs something like the following:
<param-list>
<param id="1">
<name>foo</name>
<value>bar</name>
</param>
...
</param-list>
<param:if name="foo"
</param:if>>
Executes the code contained within the block if the named parameter's value is true. You can optionally supply the attribute "value" if you want to evaluate the value of a parameter against an exact string.
This tag, as well as all the other similar tags mentioned below can be changed to "unless" to perform the exact opposite (ala Perl's "unless"). All options must be supplied as attributes; child elements can not be used to supply these values.
<param:if-exists name="foo"
</param:if-exists>>
Executes the code contained within the block if the named parameter exists at all, regardless of it's value.
<param:if-regex name="foo" value="\w+"
</param:if-regex>>
Executes the code contained within the block if the named parameter matches the regular expression supplied in the "value" attribute. The "value" attribute is required.
AUTHOR
Michael A Nachbaur, mike@nachbaur.com
COPYRIGHT
Copyright (c) 2002-2003 Michael A Nachbaur. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.