Ejemplo n.º 1
0
 /**
  * Add a decorator to the element.
  * 
  * @param Decorator|string $decorator  Decorator object or name
  * @param mixed            $_          Additional arguments are passed to the constructor
  * @return Element  $this
  */
 public function addDecorator($decorator)
 {
     // parent::addDecorator($decorator, ...$_);
     call_user_func_array([get_parent_class(), 'addDecorator'], func_get_args());
     foreach ($this->getChildren() as $child) {
         if ($this->getOption('decorate') === false) {
             continue;
         }
         $decorator->apply($child, true);
     }
     return $this;
 }