Skip to content

Instantly share code, notes, and snippets.

@pkdavies
Created June 21, 2011 10:58
Show Gist options
  • Save pkdavies/1037621 to your computer and use it in GitHub Desktop.
Save pkdavies/1037621 to your computer and use it in GitHub Desktop.
Backbase Combobox + PHP
public function combobox($name, $values_array, $default=null, $size=300, $required=false){
$req_bxml = ($required)? " b:required=\"true\"" : "";
$bxml = '<b:combobox b:width="'. $size .'px" b:name="'. $name .'" b:text="'. $default .'"'. $req_bxml .'>';
foreach ($values_array as $value) {
$bxml .= '<b:combo-option b:value="'. $value['value'] .'">'. $value['name'] .'</b:combo-option>';
}
$bxml .= '</b:combobox>';
return $bxml;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment