Example #1
0
 public function __call($name, $args)
 {
     if (!preg_match('/^add/', $name)) {
         throw new BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $name);
     }
     $className = preg_replace('/^add/', '', $name);
     return $this->addControl(Controls\Item::createControl($className, $args));
 }