BabelKit Perl API Quick Reference

BabelKit Handle Creation

use DBIx::BabelKit;

$babelkit = new DBIx::BabelKit($dbh,
                table     => 'bk_code',
                getparam  => \&get_scalar,
                getparams => \&get_list
            ):

Display Methods

$code_desc = $babelkit->desc(   $code_set, $code_lang, $code_code);
$Code_desc = $babelkit->ucfirst($code_set, $code_lang, $code_code);
$Code_Desc = $babelkit->ucwords($code_set, $code_lang, $code_code);

Data Methods

$code_desc = $babelkit->render($code_set, $code_lang, $code_code);
$code_desc = $babelkit->data(  $code_set, $code_lang, $code_code);
$parameter = $babelkit->param( $code_set, $code_code);

HTML Select Common Options

print $babelkit->select('day', $lang,
                        var_name => 'start_day',
                        value    => $start_day,
                        default  => 1,
                        subset   => [ 1, 2, 3, 4, 5 ],
                        options  => 'onchange="submit()"'
                        );

HTML Select Single Value Methods

$html = $babelkit->select($code_set, $code_lang,
                          select_prompt => 'Code set description?',
                          blank_prompt  => 'None'
                          );

$html = $babelkit->radio($code_set, $code_lang,
                         blank_prompt => 'None'
                         sep          => "<br>\n",
                         );

HTML Select Multiple Value Methods

$html = $babelkit->multiple($code_set, $code_lang,
                            size => 10
                            );

$html = $babelkit->checkbox($code_set, $code_lang,
                            sep => "<br>\n"
                            );

Code Set Methods

$rows = $babelkit->lang_set($code_set, $code_lang);
$rows = $babelkit->full_set($code_set, $code_lang);

Code Table Update Methods

$babelkit->slave($code_set, $code_code, $code_desc);

$babelkit->remove($code_set, $code_code);

( $code_desc, $code_order, $code_flag ) =
    $babelkit->get($code_set, $code_lang, $code_code);

$babelkit->put($code_set,  $code_lang,  $code_code,
               $code_desc, $code_order, $code_flag);