original_string: public static function checkbox($name, $value, $checked = true, $label = '', array $attributes = null) {
          $attributes = (array)$attributes;
          $output = '';
  
          if ($label !== '' and !is_null($label)) {
              if (empty($attributes['id'])) {
                  $attributes['id'] = self::random_id('checkbox_');
              }
          }
          $attributes['type']    = 'checkbox';
          $attributes['value']   = $value;
          $attributes['name']    = $name;
          $attributes['checked'] = $checked ? 'checked' : null;
  
          $output .= self::empty_tag('input', $attributes);
  
          if ($label !== '' and !is_null($label)) {
              $output .= self::tag('label', $label, array('for'=>$attributes['id']));
          }
  
          return $output;
      }
code: public static function checkbox($name, $value, $checked = true, $label = '', array $attributes = null) {
          $attributes = (array)$attributes;
          $output = '';
  
          if ($label !== '' and !is_null($label)) {
              if (empty($attributes['id'])) {
                  $attributes['id'] = self::random_id('checkbox_');
              }
          }
          $attributes['type']    = 'checkbox';
          $attributes['value']   = $value;
          $attributes['name']    = $name;
          $attributes['checked'] = $checked ? 'checked' : null;
  
          $output .= self::empty_tag('input', $attributes);
  
          if ($label !== '' and !is_null($label)) {
              $output .= self::tag('label', $label, array('for'=>$attributes['id']));
          }
  
          return $output;
      }
code_tokens: public static function checkbox ( $ name , $ value , $ checked = true , $ label = '' , array $ attributes = null ) { $ attributes = ( array ) $ attributes ; $ output = '' ; if ( $ label !== '' and ! is_null ( $ label ) ) { if ( empty ( $ attributes [ 'id' ] ) ) { $ attributes [ 'id' ] = self :: random_id ( 'checkbox_' ) ; } } $ attributes [ 'type' ] = 'checkbox' ; $ attributes [ 'value' ] = $ value ; $ attributes [ 'name' ] = $ name ; $ attributes [ 'checked' ] = $ checked ? 'checked' : null ; $ output .= self :: empty_tag ( 'input' , $ attributes ) ; if ( $ label !== '' and ! is_null ( $ label ) ) { $ output .= self :: tag ( 'label' , $ label , array ( 'for' => $ attributes [ 'id' ] ) ) ; } return $ output ; }
docstring: Generates a simple checkbox with optional label
  
  @param string $name The name of the checkbox
  @param string $value The value of the checkbox
  @param bool $checked Whether the checkbox is checked
  @param string $label The label for the checkbox
  @param array $attributes Any attributes to apply to the checkbox
  @return string html fragment
docstring_tokens: Generates a simple checkbox with optional label