Thats not too hard. Here is an example: The function only requires the two parametrs specified in the function header, $fieldName and $fieldValue. However, you can send more variables and retreive them by getting ALL the parameters with the func_get_args() .. Keep in mind that you need to "skip" those in the parameter list. The comments specify what I indend for the paramter list to be. Keep in mind the order is important when retreiving the additional parameters!
Hope that helps
//*******
// printCheckBox: returns the code for a checkbox
// Parameters:
// fieldName - name for the field
// fieldValue - value for field
// Arg 2 - checked
// Arg 3 - label for display after checkbox
// Arg 4 - string of additional params (Ex "style='color:red;'")
//******
function printCheckBox($fieldName, $fieldValue) {
$aArgs = func_get_args();
$fieldName = "name=\"$fieldName\"";
$fieldValue = " value=\"$fieldValue\"";
$checked = ($aArgs[2] == 1) ? "checked" : "";
$label = ($aArgs[3] != "") ? "$aArgs[3]\n" : "";
$addParams = ($aArgs[4] != "") ? "$aArgs[4]" : "";
return ttIndentStr(0) . ( "<input type=\"checkbox\" $fieldName $fieldValue $checked $addParams>$label");
}