original_string: public function generateCheckboxField($attr)
      {
          if (empty($attr['name'])) {
              return '';
          }
  
          $out = '';
  
          if ((isset($attr['hiddenCheckbox']) && $attr['hiddenCheckbox']) || ! isset($attr['hiddenCheckbox'])) {
              $out .= $this->input(
                  $attr['name'],
                  false,
                  array(
                      'type' => 'hidden',
                      'wrapper' => false,
                      'id' => '_' . $attr['id'],
                      'value' => 0
                  )
              );
          }
          unset($attr['hiddenCheckbox']);
  
          if (! isset($attr['value'])) {
              $attr['value'] = 1;
          }
  
          $out .= $this->Html->tag('input', $attr);
          return $out;
      }
code: public function generateCheckboxField($attr)
      {
          if (empty($attr['name'])) {
              return '';
          }
  
          $out = '';
  
          if ((isset($attr['hiddenCheckbox']) && $attr['hiddenCheckbox']) || ! isset($attr['hiddenCheckbox'])) {
              $out .= $this->input(
                  $attr['name'],
                  false,
                  array(
                      'type' => 'hidden',
                      'wrapper' => false,
                      'id' => '_' . $attr['id'],
                      'value' => 0
                  )
              );
          }
          unset($attr['hiddenCheckbox']);
  
          if (! isset($attr['value'])) {
              $attr['value'] = 1;
          }
  
          $out .= $this->Html->tag('input', $attr);
          return $out;
      }
code_tokens: public function generateCheckboxField ( $ attr ) { if ( empty ( $ attr [ 'name' ] ) ) { return '' ; } $ out = '' ; if ( ( isset ( $ attr [ 'hiddenCheckbox' ] ) && $ attr [ 'hiddenCheckbox' ] ) || ! isset ( $ attr [ 'hiddenCheckbox' ] ) ) { $ out .= $ this -> input ( $ attr [ 'name' ] , false , array ( 'type' => 'hidden' , 'wrapper' => false , 'id' => '_' . $ attr [ 'id' ] , 'value' => 0 ) ) ; } unset ( $ attr [ 'hiddenCheckbox' ] ) ; if ( ! isset ( $ attr [ 'value' ] ) ) { $ attr [ 'value' ] = 1 ; } $ out .= $ this -> Html -> tag ( 'input' , $ attr ) ; return $ out ; }
docstring: generate a checkbox
  
  @param   array   array of attributes
  @return  string
docstring_tokens: generate a checkbox