Ejemplo n.º 1
0
 /**
  * Returns a guaranteed valid HTML attribute. Removes illegal characters.
  * Allows for 'naked' attributes, without a value.
  * @param string $name
  * @param string|array|bool $value
  * @return string
  */
 public static function attribute($name, $value)
 {
     if ($name === $value) {
         return ' ' . self::name($name);
     } else {
         if (is_numeric($name)) {
             return ' ' . self::name($value);
         } else {
             return \arc\xml::attribute($name, $value);
         }
     }
 }
Ejemplo n.º 2
0
 protected function getAttributes($attributes)
 {
     $result = '';
     if (count($attributes)) {
         foreach ($attributes as $name => $value) {
             $result .= \arc\xml::attribute($name, $value);
         }
     }
     return $result;
 }
Ejemplo n.º 3
0
 public static function attribute($name, $value)
 {
     return \arc\xml::attribute($name, $value);
 }