public function actionCreate($parent = 0)
    {
        $installModel = new CreateModule(['tc' => $this->module->tcModule]);

        $post = Yii::$app->request->post();
        if (empty($post)) {
            $installModel->loadDefaultValues();
            $installModel->parentUid = ModulesManager::numberedIdFromDbId($parent);
        } else {
            $installModel->load($post);
            $installModel->moduleClassFile = UploadedFile::getInstance($installModel, 'moduleClassFile');
            $result = $installModel->validate();
            if ($result) {
                //$modelManager = new Modmgr(['tc' => $this->module->tcModule]);
                $modelManager = new Modmgr();
                $modelManager->loadData($installModel);
                if (!$modelManager->hasErrors() && $modelManager->save()) {
                    //return $this->redirect(['view', 'id' => $modelManager->id]);
                    return $this->redirect(['update', 'id' => $modelManager->id]);
                }

                // merge errors to $installModel
                foreach ($modelManager->errors as $attribute => $errors) {
                    if ($attribute == 'module_id') {
                        foreach ($errors as $error) $installModel->addError('moduleId', $error);
                    } elseif ($attribute == 'module_class') {
                        foreach ($errors as $error) $installModel->addError('moduleClassFile', $error);
                    } else { //?? need error message not attached to any field
                        foreach ($errors as $error) $installModel->addError('moduleClassFile', $error);
                    }
                }
            }
        }
        return $this->render('create', [
            'model' => $installModel,
        ]);
    }