public function init()
{
if (empty($this->models)) {
throw new InvalidConfigException('You must specify "models"');
}
if ($this->form !== null && !$this->form instanceof ActiveForm) {
throw new InvalidConfigException('Property "form" must be an instance of yii\\widgets\\ActiveForm');
}
foreach ($this->models as $model) {
if (!$model instanceof Model) {
throw new InvalidConfigException('Model has to be an instance of yii\\base\\Model');
}
}
parent::init();
}