Wolfgang Sourdeau > CGI-Listman-0.05 > CGI::Listman::dictionary::term

Download:
CGI-Listman-0.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

CGI::Listman::dictionary::term - element of a CGI::Listman::dictionary

SYNOPSIS ^

    use CGI::Listman::dictionary::term;

DESCRIPTION ^

A CGI::Listman::dictionary::term is what an instance of CGI::Listman::dictionary is made of. In our terminology, a "term" is made of a "key" and a "definition". The similarity with the words in a lingual dictionary is not innocent.

Within a CGI script, you are most certainly receiving and transmitting variables to a form. A couple of those variables will be of internal use only while the others will be part of the interactivity with your users. Generally, those variables will have names that are explicit to you as a programmer; however they might mean nothing or little to a normal user.

Now, in the context of CGI::Listman, those variables are juste fields of a database row and it makes even less sense to give them a user-explicit name (imagine a name such as "Your father's forename"). So the key of a CGI::Listman::dictionary::line will represent a database column and the definition will be its user representation. This is mostly useful when you have to represent those variables in the sight of your users; for example when validating user input (see CGI::Listman's method check_params).

A CGI::Listman::dictionary::term also contains validation information. Currently it only supports a flag indicating whether the field is mandatory or not but it will probably contain other flags in a later release.

API ^

new

This method is to instantiate a term. It optionnally takes arguments for the term's key, definition and mandatory flag. All the parameters are optional with this method.

Parameters
key

A string representing the term's key.

definition

A string representing the term's definition.

mandatory

A boolean (0 or 1) integer defining whether user input is required or not for this term.

Return values

This method returns a blessed reference to a CGI::Listman::dictionary::term.

set_key

This method set the term's key to the provided value.

Parameters
key

A string representing the term's key.

Return values

This method returns nothing.

set_definition

This method set the term's definition to the provided value.

Parameters
definition

A string representing the term's definition.

Return values

This method returns nothing.

set_mandatory

This method declares that user input is required for this term.

Parameters

This method take no parameter.

Return values

This method returns nothing.

definition

This method returns the definition for the specified instance of CGI::Listman::dictionary::term.

Parameters

This method take no parameter.

Return values

This method returns a string representing either the term's definition.

definition_or_key

This method returns the definition for the specified instance of CGI::Listman::dictionary::term. If the definition is not existing, the key is returned instead.

Parameters

This method take no parameter.

Return values

This method returns a string representing either the term's definition or its key whenever its definition is void.

AUTHOR ^

Wolfgang Sourdeau, <Wolfgang@Contre.COM>

COPYRIGHT ^

Copyright (C) 2002 iScream multimédia <info@iScream.ca>

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

CGI::Listman(3) CGI::Listman::dictionary(3)

syntax highlighting: