Ejemplo n.º 1
0
 /**
  * Creates an HTML form checkbox input tag.
  *
  * @param   string|array  input name or an array of HTML attributes
  * @param   string        input value, when using a name
  * @param   boolean       make the checkbox checked by default
  * @param   string        a string to be attached to the end of the attributes
  * @return  string
  */
 public static function checkbox($data, $value = NULL, $checked = NULL, $extra = '')
 {
     // Add the Bluebox defaults (such as css classes)
     list($data, $value, $checked, $extra) = self::_addDefaults(__FUNCTION__, $data, $value, $checked, $extra);
     // Call the parent
     $result = self::hidden('__' . $data['name'], $data['unchecked']);
     unset($data['unchecked']);
     // Call the parent
     $result .= parent::checkbox($data, $value, $checked, $extra);
     return $result;
 }
 public static function checkbox($data, $value = '1', $checked = FALSE, $extra = '')
 {
     $checked = self::get_value($data, $checked);
     return parent::checkbox($data, $value, $checked, $extra);
 }