Creates a new AuthItem model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
163842
public function actionCreate()
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['create']);
        }
        try
        {
            $model = new BizRule(null);
            if(!array_key_exists('BizRule', Yii::$app->request->post())){
                return ['success'=>false,'message'=>'参数错误！'];
            }
            $mo =$model->find(Yii::$app->request->post()['BizRule']['name']);
            if($mo==null){
                if ($model->load(Yii::$app->request->post()) ) {
                    $classExists = $model->classExists();
                    if($classExists==$model::RIGHTCLASS){
                        $model->save();
                        $result=['success'=>true,'message'=>'规则已成功添加！'];
                        return $result;
                    }else{
                        return ['success'=>false,'message'=>'规则类不存在！'];
                    }


                } else {
                    return ['success'=>false,'message'=>'参数错误！'];
                }
            }else{
                return ['success'=>false,'message'=>'规则已存在！'];
            }

        }catch(Exception $e){
            throw new \yii\web\ServerErrorHttpException();
        }

    }
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,
        ]);
    }
852656
public function actionCreate() {
    $form = new RoleForm();
    $form->isNewRecord = true;
    $form->auth = Yii::$app->authManager;

    if ($form->load(Yii::$app->request->post()) && $form->save()) {
      Yii::$app->session->setFlash('success', 'Роль создана');
      return $this->redirect(['view', 'id' => $form->name]);
    } else {
      return $this->render('create', [
        'form' => $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,
            ]);
        }
    }
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,
        ]);
    }
1310805
public function createAuthCode()
	{
		$authParams = Authorizer::getAuthCodeRequestParams();
		$formParams = array_except($authParams,'client');
		$formParams['client_id'] = $authParams['client']->getId();

		$scope_collection = new \Illuminate\Database\Eloquent\Collection();
		foreach($authParams['scopes'] as $scope)
		{
			$scope_collection->add(Scope::findOrFail($scope->getId()));
		}
		return view('oauth.authorization-form')
			->with('params', $formParams)
			->with('client', $authParams['client'])
			->with('scopes', $scope_collection);
	}
122608
protected function createModel()
    {
        $model = new ResetPasswordModel();
        $model->identityColumnName = $this->getLoginProvider()->getSettings()->identityColumnName;
        $model->resetPasswordEvent->attachHandler(function(){
            $this->initiateResetPassword();
        });

        return $model;
    }
1329409
public function actionCreate()
    {
        $model = $this->module->manager->createBlock(['scenario' => 'create']);

        if ($model->load(\Yii::$app->request->post()) && $model->create()) {
            \Yii::$app->getSession()->setFlash('block.success', \Yii::t('block', 'Block has been created'));
            return $this->redirect(['index']);
        }

        return $this->render('create', [
            'model' => $model
        ]);
    }
471623
public function actionCreate()
    {
        $model = new SeoPresets();
        $model->loadDefaultValues();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            if(Yii::$app->request->post('action') === 'apply') {
                return $this->redirect(['update', 'id' => $model->id]);
            }else{
                return $this->redirect(['view', 'id' => $model->id]);
            }
        }

        return $this->render('create', [
            'model' => $model,
        ]);
    }
617742
public function create()
    {
        $this->authorize(RedirectsPolicy::PERMISSION_CREATE);

        $statuses = RedirectStatuses::all();

        $this->setTitle($title = trans('seo::redirects.titles.create-redirection'));
        $this->addBreadcrumb($title);

        return $this->view('admin.redirects.create', compact('statuses'));
    }
540139
public function create()
	{
		$return = Input::get('return');
		if (empty($return))
		{
			return Redirect::to('/');
		}
		try {
			$commentable = Input::get('commentable');
			if (empty($commentable))
			{
				throw new Exception();
			}
			$commentable = Crypt::decrypt($commentable);
			if (strpos($commentable, '.') == false)
			{
				throw new Exception();
			}
			list($commentableType, $commentableId) = explode('.', $commentable);
			if (!class_exists($commentableType))
			{
				throw new Exception();
			}
			$data = array(
				'commentable_type' => $commentableType,
				'commentable_id' => $commentableId,
				'comment' => Input::get('comment'),
				'user_id' => Auth::user()->id,
			);
			$rules = $this->comment->getRules($commentableType);
			$validator = Validator::make($data, $rules);
			if ($validator->fails())
			{
				return Redirect::to($return)->withErrors($validator);
			}
			$this->comment->fill($data);
			$this->comment->save();
			$newCommentId = $this->comment->id;
			return Redirect::to($return.'#C'.$newCommentId);

		} catch (\Exception $e) {

			return Redirect::to($return.'#'.trans('laravel-comments::messages.add_form_anchor'))
				->with('laravel-comments::error', trans('laravel-comments::messages.unexpected_error'));

		}

	}
875558
protected function createModel()
    {
        $model = $this->token->getModel();

        $model->applyFormatting();
        if ($this->useFakeForm && $this->token->hasSuccesCode() && (! $this->token->isCompleted())) {
            $model->set('gto_id_token', 'formatFunction', array(__CLASS__, 'makeFakeForm'));
        } else {
            $model->set('gto_id_token', 'formatFunction', 'strtoupper');
        }
        $model->setBridgeFor('itemTable', 'ThreeColumnTableBridge');

        return $model;
    }
542125
public function actionCreate()
    {
        $model = new WarehouseVoucherItems();

        if ($model->loadAll(request()->post()) && $model->saveAll()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
1021883
public function actionCreate()
    {
        $model = new BizRule(null);
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Helper::invalidate();

            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' => [],
            ]);
        }
    }
317247
public function actionCreate()
    {
        $model = new Post();
        $model->load(Yii::$app->request->get());

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('postSaved');
            return $this->redirect(['update', 'id' => $model->id]);
        }

        if ($model->type->show_category) {
            $model->setScenario('required_category');
        }

        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,
        ]);
    }