@inheritDoc

@see https://github.com/yiisoft/yii2/issues/384
@see \yii\console\controllers\BaseMigrateController::actionCreate()
430105
public function actionCreate($name, $module = false)
    {
        if (empty($module)) {
            return parent::actionCreate($name);
        }
        
        if (!isset($this->migrationPath[$module])) {
            throw new Exception("The module \"$module\" does not exist in the application modules configuration.");
        }
        
        // apply custom migration code to generate new migrations for a module specific path
        if (!preg_match('/^[\w\\\\]+$/', $name)) {
            throw new Exception('The migration name should contain letters, digits, underscore and/or backslash characters only.');
        }
        
        $className = 'm'.gmdate('ymd_His').'_'.$name;
        
       
        $migrationPath = $this->migrationPath[$module];
        
        $file = $migrationPath . DIRECTORY_SEPARATOR . $className . '.php';
        if ($this->confirm("Create new migration '$file'?")) {
            $content = $this->generateMigrationSourceCode([
                'name' => $name,
                'className' => $className,
                'namespace' => null,
            ]);
            FileHelper::createDirectory($migrationPath);
            file_put_contents($file, $content);
            $this->stdout("New migration created successfully.\n", Console::FG_GREEN);
        }
    }
522487
public function actionCreate()
    {
        $model = Yii::createObject($this->modelClass);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('yii2mod.cms', 'Page has been created.'));

            return $this->redirect(['index']);
        }

        return $this->render($this->createView, [
            'model' => $model,
        ]);
    }
139051
public function actionCreate()
    {
        /** @var User $user */
        $user = \Yii::createObject([
            'class'    => User::className(),
            'scenario' => 'create',
        ]);
        $event = $this->getUserEvent($user);

        $this->performAjaxValidation($user);

        $this->trigger(self::EVENT_BEFORE_CREATE, $event);
        if ($user->load(\Yii::$app->request->post()) && $user->create()) {
            \Yii::$app->getSession()->setFlash('success', \Yii::t('user', 'User has been created'));
            $this->trigger(self::EVENT_AFTER_CREATE, $event);
            return $this->redirect(['update', 'id' => $user->id]);
        }

        return $this->render('create', [
            'user' => $user,
        ]);
    }
867531
public function actionCreate()
    {
        $model = new Dump($this->getModule()->dbList);
        if (ArrayHelper::isIn($this->db, $this->getModule()->dbList)) {
            $dbInfo = $this->getModule()->getDbInfo($this->db);
            $dumpOptions = $model->makeDumpOptions();
            if ($this->gzip) {
                $dumpOptions['isArchive'] = true;
            }
            $manager = $this->getModule()->createManager($dbInfo);
            $dumpPath = $manager->makePath($this->getModule()->path, $dbInfo, $dumpOptions);
            $dumpCommand = $manager->makeDumpCommand($dumpPath, $dbInfo, $dumpOptions);
            Yii::trace(compact('dumpCommand', 'dumpPath', 'dumpOptions'), get_called_class());
            $process = new Process($dumpCommand);
            $process->run();
            if ($process->isSuccessful()) {
                if ($this->storage) {
                    if (Yii::$app->has('backupStorage')) {
                        $dumpText = fopen($dumpPath, 'r+');
                        Yii::$app->backupStorage->writeStream(StringHelper::basename($dumpPath), $dumpText);
                        fclose($dumpText);
                    } else {
                        Console::output('Storage component is not configured.');
                    }
                }
                Console::output('Dump successfully created.');
            } else {
                Console::output('Dump failed create.');
            }
        } else {
            Console::output('Database configuration not found.');
        }
    }
726530
public function actionCustomCreate()
    {
        $model = new Options();
        $model->type = Options::TYPE_CUSTOM;
        if ($model->load(yii::$app->getRequest()->post()) && $model->save()) {
            yii::$app->getSession()->setFlash('success', yii::t('cms', 'Success'));
            return $this->redirect(['custom']);
        } else {
            $errors = $model->getErrors();
            $err = '';
            foreach ($errors as $v) {
                $err .= $v[0] . '<br>';
            }
            //Yii::$app->getSession()->setFlash('error', yii::t('cms', $err));
            yii::$app->getResponse()->format = Response::FORMAT_JSON;
            return [
                'err_msg' => $err,
            ];
        }
    }
1284667
public function actionCreate()
    {
        $this->layout = static::FORM_LAYOUT;
        $model = new $this->MainModel;

        if ($model->load(Yii::$app->request->post()) && $model->validate()) {
            if(empty($model->Menu_id)) {
                Yii::info('Making the new node as root');
                $model->makeRoot();
            } else {
                $parent_node = Menu::findOne($model->Menu_id);
                $model->appendTo($parent_node);

                Yii::info('Making the new node as a child of ' . $parent_node->id);
            }
            $this->saveHistory($model, $this->historyField);
            return $this->redirect(['index']);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
678053
public function actionCreate()
    {
        $rr = new ResponseHelper();
        $showing = new BackendShowing();

        if (\Yii::$app->request->post()) {
            if (\Yii::$app->request->get('sx-validate')) {
                return $rr->ajaxValidateForm($showing);
            } else {
                if ($showing->load(\Yii::$app->request->post()) && $showing->save()) {
                    $rr->success = true;
                }
            }
        }

        return $rr;
    }
99940
public function actionCreate()
    {
        $model = new AuthItem(null);
        $model->type = $this->type;
        if ($model->load(Yii::$app->getRequest()->post()) && $model->save()) {
            Helper::invalidate();

            return $this->redirect(['view', 'id' => $model->name]);
        } else {
            return $this->render('create', ['model' => $model]);
        }
    }
605154
public function actionCreate()
    {
        $model = new WechatForm();
        if ($model->load(Yii::$app->request->post())) {
            if (Request::isAjax()) {
                Yii::$app->getResponse()->format = Response::FORMAT_JSON;
                return ActiveForm::validate($model);
            } elseif ($model->save()) {
                return $this->flash('公众号创建成功! 请补充余下公众号设置以激活公众号', 'info', ['update', 'id' => $model->id]);
            }
        }
        return $this->render('create', [
            'model' => $model
        ]);
    }
1065319
public function actionAssign()
    {
        $post = Yii::$app->getRequest()->post();
        $action = $post['action'];
        $routes = $post['routes'];
        $manager = Yii::$app->getAuthManager();
        $error = [];
        if ($action == 'assign') {
            $this->saveNew($routes);
        } else {
            foreach ($routes as $route) {
                $child = $manager->getPermission($route);
                try {
                    $manager->remove($child);
                } catch (Exception $exc) {
                    $error[] = $exc->getMessage();
                }
            }
        }
        Helper::invalidate();
        Yii::$app->getResponse()->format = 'json';
        return array_merge($this->getRoutes(), ['errors' => $error]);
    }
1182806
public function actionCreate()
    {
        if (($source = $this->findModel(Yii::$app->request->post('source_id'))) != null) {
            $model = new Comment();
            $model->scenario = Comment::SCENARIO_CREATE;
            if ($model->load(Yii::$app->request->post(), '') && $model->save()) {
                $source->updateCounters(['comments' => 1]);
                if ($model->to_user_id > 0) {
                    notify(Yii::$app->user->id, $model->to_user_id, 'reply_comment',  $source->title, $source->id, $model->content, 'article', $source->id);
                } else {
                    notify(Yii::$app->user->id, $source->user_id, 'comment_article',  $source->title, $source->id, $model->content, 'article', $source->id);
                }
                return $this->renderPartial('detail', ['model' => $model]);
            }
        }
        throw new NotFoundHttpException(Yii::t('yii', 'The requested page does not exist'));
    }
802520
public function actionCreate()
    {
        $model = new Template();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['index', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
632952
public function actionCreate()
{
$model = new Country;

try {
if ($model->load($_POST) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} elseif (!\Yii::$app->request->isPost) {
$model->load($_GET);
}
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2]))?$e->errorInfo[2]:$e->getMessage();
$model->addError('_exception', $msg);
}
return $this->render('create', ['model' => $model]);
}
924260
public function actionCreate()
	{
		$post=new Post;
		if(Yii::app()->request->isPostRequest)
		{
			if(isset($_POST['Post']))
				$post->setAttributes($_POST['Post']);
			if($post->save())
				$this->redirect(array('show','id'=>$post->id));
		}
		$this->render('create',array('post'=>$post));
	}
684024
public function actionCreate()
    {
        $model = new Article();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->getSession()->setFlash('success', Yii::t('article', 'Create success.'));
            return $this->redirect(['view', 'id' => $model->id]);
        }
        return $this->render('create', [
            'model' => $model,
        ]);
    }
676673
public function actionCreate()
    {
        $model = new Event();
        $model->plugin_id = Plugin::EVENTS_CORE;

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect('index');
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
186654
private function actionCreate()
    {
        $forms = $this->plugin->getForms();
        $name = arg('name');
        if ($forms->get($name) === false)
        {
            $forms->add($name, arg('code'), arg('title'));
            HTTP::redirect(arg('submitURL'));
        }
        ErrorMessage('Форма с таким именем уже есть! Укажите другое имя.');
        return $this->actionAddDialog();
    }