public function __call($name, $args) { if ($name === 'render') { if (isset($args[0]) && is_array($args[0]) && isset($args[0]['config'])) { $this->configureControl($args[0]['config']); } if (method_exists($this, 'renderDefault')) { call_user_func_array(array($this, 'renderDefault'), $args); } $this->template->setFile($this->formatTemplateFile()); $this->template->render(); if (method_exists($this, 'afterRender')) { call_user_func_array(array($this, 'afterRender'), array()); } if (isset($args[0]) && is_array($args[0]) && isset($args[0]['config'])) { $this->unconfigureControl(); } return; } return parent::__call($name, $args); }