code: public function renderAttributes(array $attributes, array $defaults = array())
      {
          $s = '';
          foreach ($attributes as $name => $value) {
              if ( array_key_exists($name, $defaults) ) {
                  $value = $value.' '.$defaults[$name];
              }
              $s .= sprintf(' %s="%s"', $name, $value);
          }
          foreach ($defaults as $name => $value) {
              if ( !array_key_exists($name, $attributes) ) {
                  $s .= sprintf(' %s="%s"', $name, $value);
              }
          }
          return $s;
      }
docs: renderAttributes
  
  @param array $attributes attributes to render
  @param array $defaults   defaults value
  
  @return [type]