Пример #1
0
 public function __construct($arg_array = null)
 {
     $args = func_get_args();
     parent::__construct('class', $args);
 }
Пример #2
0
 /**
  * Appends the value to an existing attribute or creates the
  * attribute if it does not yet exist.
  *
  * @param string $name
  * @param mixed $value
  * @param string $offset Optional offset for adding
  * @return \MUtil_Html_HtmlElement
  */
 public function appendAttrib($name, $value, $offset = null)
 {
     $attrib = $this->{$name};
     if ($attrib instanceof \MUtil_Lazy_LazyInterface) {
         $attrib = new \MUtil_Html_ArrayAttribute($name, $attrib);
     } elseif ($attrib && $value instanceof \MUtil_Lazy_LazyInterface) {
         if (!$attrib instanceof \MUtil_Html_AttributeInterface) {
             $attrib = new \MUtil_Html_ArrayAttribute($name, $attrib);
         }
     }
     if ($attrib instanceof \MUtil_Html_AttributeInterface) {
         $attrib->add($offset, $value);
     } elseif (is_array($attrib) || $attrib instanceof \ArrayAccess) {
         if (null !== $offset) {
             $attrib[$offset] = $value;
         } elseif (!in_array($value, $attrib)) {
             // Prevent double adding to attributes
             $attrib[] = $value;
         }
     } elseif ($attrib) {
         $attrib .= ' ' . $value;
     } else {
         $attrib = $value;
     }
     $this->{$name} = $attrib;
     return $this;
 }
 /**
  *
  * @param string $type
  * @param mixed $arg_array \MUtil_Ra::args
  */
 public function __construct($type, $arg_array = null)
 {
     $args = \MUtil_Ra::args(func_get_args(), 1);
     parent::__construct($type, 'javascript:', $args);
 }