Creates a new AuthItem model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
558060
public function actionCreate()
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['create']);
        }
        try{
            $routes = Yii::$app->getRequest()->post('route', '');
            $routes = preg_split('/\s*,\s*/', trim($routes), -1, PREG_SPLIT_NO_EMPTY);
            $methods = Yii::$app->getRequest()->post('methods', '');
            $model = new Route();
            $model->addNewMethod($routes,$methods);
            return $model->getRoutes();
        }catch(Exception $e){
            throw new Exception($e);
        }

    }
1004401
public function create() {

        // Is this user allowed to do this?
        if (!$this->repository->isUserAllowed('create')) {
            Session::flash('status_code', 400 );
            $message = "You are not allowed to create ".$this->model->table;
            Session::flash('message', $message);
            return view('formhandling::warnings/' . config('lasallecmsadmin.admin_template_name') . '/user_not_allowed', [
                'package_title'                => $this->model->package_title,
                'table_type_plural'            => $this->model->table,
                'resource_route_name'          => $this->model->resource_route_name,
                'table_type_singular'          => strtolower($this->model->model_class),
                'HTMLHelper'                   => HTMLHelper::class,
            ]);
        }

        return view('lasallecmsemail::admin/emailhandling/create',
        [
            'user'                             => Auth::user(),
            'repository'                       => $this->repository,
            'package_title'                    => $this->model->package_title,
            'table_name'                       => $this->model->table,
            'model_class'                      => $this->model->model_class,
            'resource_route_name'              => $this->model->resource_route_name,
            'DatesHelper'                      => DatesHelper::class,
            'HTMLHelper'                       => HTMLHelper::class,
            'Config'                           => Config::class,
            'admin_template_name'              => config('lasallecmsadmin.admin_template_name'),
        ]);
    }
241780
public function create()
    {
        if (\Auth::user()->id == 1 || \Auth::user()->id == 2) {
            return view('adminems::users.create');
        }

        return redirect()->route('panel');
        
    }
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,
            ];
        }
    }
78733
public function actionCreate()
    {
        $model = new AuthItemForm('create');

        if (isset($_POST['AuthItemForm'])) {
            $model->attributes = $_POST['AuthItemForm'];
            if ($model->validate()) {
                /* @var $am CAuthManager|AuthBehavior */
                $am = Yii::app()->getAuthManager();

                if (($item = $am->getAuthItem($model->name)) === null) {
                    $item = $am->createAuthItem($model->name, $model->type, $model->description);
                    if ($am instanceof CPhpAuthManager) {
                        $am->save();
                    }
                }

                $this->redirect(array('view', 'name' => $item->name));
            }
        }

        $model->type = $this->type;

        $this->render(
            'create',
            array(
                'model' => $model,
            )
        );
    }
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'));

		}

	}
251096
public function actionLogin()
	{
		$model = new LoginForm();
		//make the captcha required if the unsuccessful attempts are more of thee
		if ($this->getLoginAttempts() >= $this->module->attemptsBeforeCaptcha) {
			$model->scenario = 'withCaptcha';
		}

        if(Yii::$app->request->post()) {
            if($model->load($_POST) && $model->login()) {
                $this->setLoginAttempts(0); //if login is successful, reset the attempts
                return $this->goBack();
            } else {
                //if login is not successful, increase the attempts
                $this->setLoginAttempts($this->getLoginAttempts() + 1);
            }
		}

		return $this->render('login', [
			'model' => $model,
		]);
	}
423041
public function create()
    {
        // Is this user allowed to do this?
        if (!$this->repository->isUserAllowed('create'))
        {
            Session::flash('status_code', 400 );
            $message = "You are not allowed to create ".$this->table_type_plural;
            Session::flash('message', $message);
            return view('formhandling::warnings/' . config('lasallecmsadmin.admin_template_name') . '/user_not_allowed', [
                'package_title'        => $this->package_title,
                'table_type_plural'    => $this->table_type_plural,
                'table_type_singular'  => $this->table_type_singular,
                'resource_route_name'  => $this->resource_route_name,
                'HTMLHelper'           => HTMLHelper::class,
            ]);
        }

        return view('formhandling::lookuptables/' . config('lasallecmsadmin.admin_template_name') . '/create', [
            'package_title'        => $this->package_title,
            'table_type_plural'    => $this->table_type_plural,
            'table_type_singular'  => $this->table_type_singular,
            'resource_route_name'  => $this->resource_route_name,
            'DatesHelper'          => DatesHelper::class,
            'HTMLHelper'           => HTMLHelper::class,
        ]);
    }
257713
public function actionCreate()
    {
        $model = new AuthItem(null);
        $model->type = Item::TYPE_ROLE;
        if (\Yii::$app->request->isAjax && !\Yii::$app->request->isPjax) {
            $model->load(\Yii::$app->request->post());
            \Yii::$app->response->format = Response::FORMAT_JSON;
            return ActiveForm::validate($model);
        }
        if ($model->load(Yii::$app->getRequest()->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->name]);
        } else {
            return $this->render('create', ['model' => $model,]);
        }
    }
469157
public function actionCreate()
    {
        $model = New Note();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->getSession()->setFlash('success', Yii::t('note', 'Note created.'));
            return $this->redirect(['index']);
        }
        return $this->render('create', ['model' => $model]);
    }
386603
public function createAction()
    {
        // Load form
        $entityClass = $this->getModuleNamespace() . '\Entity\\' . $this->getEntityName();
        $entity      = new $entityClass();
        $form        = $this->getForm('Create' . $this->getEntityName());
        $form->bind($entity);

        // Implement Post/Redirect/Get pattern
        $prg = $this->prg();
        if ($prg instanceof Response) {
            return $prg;
        } else if (false !== $prg) {

            // Set form data
            $form->setData($prg);

            // Create account
            $result = $this->getService()->create();
            if ($result) {
                return $this->redirect()->toRoute($this->indexRoute);
            }
        }

        // Set up view model
        $viewModel = new ViewModel(array(
            'entityName' => $this->getEntityName(),
            'form'       => $form,
        ));
        $viewModel->setTemplate('infinity-base/crud/create');

        return $viewModel;
    }
399716
public function create()
    {
        if ($this->validate()) {

            $auth = Yii::$app->authManager;
            $role = $auth->getRole($this->roleName);
            if(!$role) {
                return null;
            }

            $user = new User();
            $user->username = $this->username;
            $user->email = $this->email;
            $user->setPassword($this->password);
            $user->generateAuthKey();
            if ($user->save()) {
                $auth->assign($role, $user->getId());
                return $user;
            }
        }
        return null;
    }
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;
    }
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,
            ]);
        }
    }
1365853
public function create()
    {
        if ($this->scenario != self::SCENARIO_CREATE) {
            return false;
        }

        if (!$this->validate()) {
            return false;
        }

        $rule = \Yii::createObject([
            'class' => $this->class,
            'name'  => $this->name,
        ]);
        
        $this->authManager->add($rule);
        $this->authManager->invalidateCache();
        
        return true;
    }
1252425
public function actionCreate()
    {
        Yii::$app->getResponse()->format = 'json';
        $routes = Yii::$app->getRequest()->post('route', '');
        $routes = preg_split('/\s*,\s*/', trim($routes), -1, PREG_SPLIT_NO_EMPTY);
        $this->saveNew($routes);
        Helper::invalidate();
        return $this->getRoutes();
    }
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,
        ]);

    }