コード例 #1
0
ファイル: FluentDOM.php プロジェクト: noels/FluentDOM
 /**
  * Allow write access to "attr" as a dynamic property.
  * Call inherited method for other properties.
  *
  * This allows to set tag attributes using an array.
  *
  * @see FluentDOM/FluentDOMCore::__get()
  * @param string $name
  * @param mixed $value
  */
 public function __set($name, $value)
 {
     switch ($name) {
         case 'attr':
             if ($value instanceof FluentDOMAttributes) {
                 $this->attr($value->toArray());
             } else {
                 $this->attr($value);
             }
             return;
     }
     parent::__set($name, $value);
 }