Creates a new User model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
340271
public function actionCreate()
    {
        $model = new MultiModel([
            'models' => [
                'user' => new User(),
                'profile' => new UserProfile(),
            ],
        ]);
        $model->getModel('user')->setScenario('backend');

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->getModel('user')->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
                'roles' => ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'description'),
            ]);
        }
    }
411242
public function actionCreate()
	{
		$model = new RegistrationForm();
		$model->scenario = RegistrationForm::SCENARIO_CHECK;
		$callback = function($model) {
			\App::$domain->account->registration->activateAccount($model->login, $model->activation_code);
			$session['login'] = $model->login;
			$session['activation_code'] = $model->activation_code;
			Yii::$app->session->set('registration', $session);
			return $this->redirect(['/user/registration/set-password']);
		};
		$this->validateForm($model,$callback);
		return $this->render('create', [
			'model' => $model,
		]);
	}
616825
public function actionCreate()
    {
        $form = new DomainForm();
        if ($form->load(Yii::$app->request->post()) && $form->validate()) {
            try {
                $model = $this->service->create($form);
                return $this->redirect(['view', 'id' => $model->id]);
            } catch (\DomainException $e) {
                Yii::$app->errorHandler->logException($e);
                Yii::$app->session->setFlash('error', $e->getMessage());
            }
        }
        return $this->render('create', [
            'model' => $form,
        ]);
    }
392253
public function actionCreate()
    {
        $model = new \yongtiger\admin\models\Log();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Module::t('message', 'Successfully created.'));
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                '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,
        ]);
    }
1003713
public function actionCreateAdmin()
    {        
        $model = new UserForm;
        
        if (Cii::get($_POST, 'UserForm') != NULL)
        {
            $model->attributes = Cii::get($_POST, 'UserForm', array());
            if ($model->validate())
            {
                $response = $this->runInstaller($model);
                if (file_exists(Yii::getPathOfAlias('application.config').DS.'/main.php'))
                {
                    $this->render('admin');
                    Yii::app()->end();
                }
                else
                    Yii::app()->user->setFlash('error', $response);
            }
            
            $errors = $model->getErrors();
            $firstError = array_values($errors);
            Yii::app()->user->setFlash('error',  Yii::t('Install.main', '{{warning}} {{error}}', array(
                '{{warning}}' => CHtml::tag('strong', array(), Yii::t('Install.main', 'Warning!')),
                '{{error}}' => $firstError[0][0]
            )));
        }
        
        $this->render('createadmin', array('model' => $model));
    }
342582
public function actionCreate()
    {
        if (!\Yii::$app->user->can('create'))
            return $this->alert(Module::t('core', 'Access denied.'));

        $model = new Rubric();
        $request = \Yii::$app->getRequest();
        $loaded = $model->load($request->post());
        
        // prependTo() call validate() and save()
        if ($loaded && $model->prependTo($this->findModel($model->parent_node))) {
            return $this->redirect(['index']);
        } else {
            return $this->renderAjax('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));
	}
1336752
public function signupAction()
    {
        $form = new SignUpForm();

        if ($this->request->isPost()) {

            if ($form->isValid($this->request->getPost()) != false) {

                $user = new Users([
                    'name' => $this->request->getPost('name', 'striptags'),
                    'email' => $this->request->getPost('email'),
                    'password' => $this->security->hash($this->request->getPost('password')),
                    'profilesId' => 2
                ]);

                if ($user->save()) {
//                    return $this->dispatcher->forward([
//                        'namespace' => 'Modules\Frontend\Controllers',
//                        'controller' => 'index',
//                        'action' => 'index'
//                    ]);
                    return $this->response->redirect('index');
                }

                $this->flash->error($user->getMessages());
            }
        }

        $this->view->form = $form;
    }
273275
public function actionCreate()
    {
        $model = new Role();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->name]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
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,
        ]);
    }
103015
public function actionCreate()
    {
        $model = $this->findModel(null);
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('app', 'Successfully saved'));
            return $this->redirect(['index']);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
831447
public function actionCreate()
    {
        $model = new User();

        if ($model->loadAll(request()->post())) {
            $model->setPassword($model->password_hash);
            $model->generateAuthKey();
            if ($model->saveAll()) {
                set_flash('success_create_new_user', $array = [
                    'type'     => 'success',
                    'duration' => 3000,
                    'icon'     => 'glyphicon glyphicon-ok-sign',
                    'title'    => \t('app', 'Congratulations!'),
                    'message'  => \t('app','Your content has been saved'),
                ]);
                return $this->redirect(['update', 'id' => $model->id]);
            } else {
                set_flash('error_user_has_not_been_saved', $array = [
                    'type'     => 'danger',
                    'duration' => 3000,
                    'icon'     => 'glyphicon glyphicon-remove-sign',
                    'title'    => \t('app', 'An error has occurred!'),
                    'message'  => \t('app','Your content has not been saved'),
                ]);
            }
        }

        return $this->render('create', [
            'model' => $model,
        ]);

    }
917268
public function actionCreate()
    {
        $model = $this->getModel(Rule::SCENARIO_CREATE);

        if (\Yii::$app->request->isAjax && $model->load(\Yii::$app->request->post())) {
            \Yii::$app->response->format = Response::FORMAT_JSON;
            return ActiveForm::validate($model);
        }

        if ($model->load(\Yii::$app->request->post()) && $model->create()) {
            \Yii::$app->session->setFlash('success', \Yii::t('rbac', 'Rule has been added'));
            return $this->redirect(['index']);
        }

        return $this->render('create', [
            'model' => $model,
        ]);
    }
1374701
public function actionCreate()
    {
        $model = new AuthItem(null);
        $model->type = Item::TYPE_ROLE;
        if ($model->load(Yii::$app->getRequest()->post()) && $model->save()) {
            AccessHelper::refeshAuthCache();
            return $this->redirect(['view', 'id' => $model->name]);
        } else {
            return $this->render('create', ['model' => $model,]);
        }
    }
411901
public function actionCreate()
    {
        $model = $this->module->model('User');
        $model->loadDefaultValues();
        $model->status = $model::STATUS_DELETED;
        $model->scenario = $model::SCENARIO_CREATE;
        $model->pageSize = intval($this->module->params['pageSizeAdmin']);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['index', 'page' => $model->page, 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
                'rolesModels' => [],
            ]);
        }
    }
632188
public function create()
    {
        $roles = $this->roleRepositoryInterface->getAll()
                                               ->lists('name', 'slug');

        return $this->view('users.create')
                    ->with('roles', $roles);
    }