Hakan Ardo > DBIx-HTMLView-LATEST > DBIx::HTMLView::Field

Download:
DBIx-HTMLView-LATEST.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

  DBIx::HTMLView::Field - Base class for field classes

SYNOPSIS ^

  $fld=$post->fld('testf');
  print $fld->view_html;

DESCRIPTION ^

This is a subcalss of DBIx::HTMLView::Fld used to represent fields in the databse as well as the data contained in it. Except for the methods decsribed in the DBIx::HTMLView::Fld man page this class contains some methods for handling the data contain in the field. They are described below.

It also contains default implementations of all the virtual methods except name_vals described in that man page. For viewing this means the value is used without any formating (both for text and html), and for the edit_html method a standard <input size=80 ...> tag is used.

The size 80 can be changed by setting the edit_size key to the wanted size in the $data hash passed to the new method, see DBIx::HTMLView::Fld.

METHODS ^

$fld->val

Returns the value of this field if it's value is set. otherwise it dies with "Field conatins no data".

$fld->got_val

Return true if the value of this field is set (defined).

$fld->view_fmt($fmt_name, $fmt)

Se DBIx::HTMLView::Fld for a general description. As for the format of the fmt string used here, the following substrings will be replaced with described values:

$val - The value of this field $name - The name of this field

syntax highlighting: