public function saveConfig() { $this->beforeSave(); $conf = $this->getAttributes(); unset($conf['blockId'], $conf['widgetId'], $conf['comment']); $conf['__block'] = ['widgetId' => $this->widgetId, 'comment' => $this->comment, 'widgetClass' => DynBlockHelper::widgetClassById($this->widgetId, true), 'modelClass' => DynBlockHelper::widgetModelClassNameById($this->widgetId)]; $s = VarDumper::export($conf); $s = "<?php\nreturn " . $s . ";"; $fn = DynBlockHelper::configFile($this->blockId); file_put_contents($fn, $s); }