CodeKit PHP API Quick Reference

CodeKit Handle Creation

require_once('CodeKit.php');

$codekit = new CodeKit($dbh, array(
                         'table' => 'ck_code'
                         )):

Display Methods

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

Data Method

$code_desc = $codekit->data(  $code_set, $code_code);

HTML Select Common Options

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

HTML Select Single Value Methods

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

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

HTML Select Multiple Value Methods

$html = $codekit->multiple($code_set, array(
                            'size' => 10
                            ));

$html = $codekit->checkbox($code_set, array(
                            'sep' => "<br>\n"
                            ));

Code Set Method

$rows = $codekit->code_set($code_set);

Code Table Update Methods

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

list( $code_desc, $code_order, $code_flag ) =
    $codekit->get($code_set, $code_code);

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