예제 #1
0
파일: HTMLTag.php 프로젝트: ksingh812/epb
 /**
  * @return string attributes
  */
 function htmlattributes(array $extra = array())
 {
     $attr_segments = array();
     $attributes = pixcustomify::merge($this->attrs->metadata_array(), $extra);
     foreach ($attributes as $key => $value) {
         if ($value !== false && $value !== null) {
             if (!empty($value)) {
                 if (is_array($value)) {
                     $htmlvalue = implode(' ', $value);
                     $attr_segments[] = "{$key}=\"{$htmlvalue}\"";
                 } else {
                     // value is not an array
                     $attr_segments[] = "{$key}=\"{$value}\"";
                 }
             } else {
                 // empty html tag; ie. no value html tag
                 $attr_segments[] = $key;
             }
         }
     }
     return implode(' ', $attr_segments);
 }