View on
MetaCPAN
Barry King > Apache-Wyrd > Apache::Wyrd::CGICond

Download:
Apache-Wyrd-0.98.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.98   Source  

NAME ^

Apache::Wyrd::CGICond - Selectively display or hide data based on CGI state

SYNOPSIS ^

    <Apache::Wyrd::CGICond var="sam">
      This text will appear if the CGI variable "sam"
      is set (has a value other than ''/0/undef)
    </Apache::Wyrd::CGICond>

    <Apache::Wyrd::CGICond var="!sam,pete">
      This text will appear if the CGI variables "sam" and "pete"
      are null (have a value of ''/0/undef)
    </Apache::Wyrd::CGICond>

    <Apache::Wyrd::CGICond var="?sam,pete">
      This text will appear if either of the CGI variables
      "sam" and "pete" are set
    </Apache::Wyrd::CGICond>

    <Apache::Wyrd::CGICond var="?!sam,pete">
      This text will appear if either of the CGI
      variables "sam" and "pete" are null
    </Apache::Wyrd::CGICond>

DESCRIPTION ^

Hides or displays enclosed text depending on the undefined/defined value of CGI parameters. Uses the Apache::Wyrd::Interfaces::Setter style meta characters to determine the behavior in relation to the named CGI parameters.

HTML ATTRIBUTES

var

Defines the salient variable(s). Multiple values are separated with commas or whitespace.

The first characters of this value provide modifiers to determine the behavior. If missing, the test will be simply for the availability of ALL the values.

a '?' will show the text if ANY of the variables are non-null, a '!' will do so if NONE of the variables are non-null. A '?!' will show the text if any of the variables are null. (see the SYNOPSIS)

PERL METHODS

NONE

BUGS/CAVEATS/RESERVED METHODS ^

Reserves the _format_output method.

AUTHOR ^

Barry King <wyrd@nospam.wyrdwright.com>

SEE ALSO ^

Apache::Wyrd

General-purpose HTML-embeddable perl object

LICENSE ^

Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.

See LICENSE under the documentation for Apache::Wyrd.

TODO ^

Variant which operates on the definition of the variable, not it's non-null status, but that might be too un-perlish :).

syntax highlighting: