Creates a new Projects model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
514281
public function actionProjectcreate()
    {
        $model = new Project();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['projectview', 'id' => $model->id]);
        } else {
            return $this->render('projectcreate', [
                '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' => [],
            ]);
        }
    }
289254
public function create()
	{
		$view = $this->getView();
		$data['product.lists.siteid'] = $this->getContext()->getLocale()->getSiteId();
		$data = array_replace_recursive( $this->toArray( $view->item ), $view->param( 'download', [] ) );

		$view->downloadData = $data;
		$view->downloadBody = '';

		foreach( $this->getSubClients() as $client ) {
			$view->downloadBody .= $client->create();
		}

		return $this->render( $view );
	}
671327
public function actionCreate()
    {
        $model = new Question();
        if ($model->load(Yii::$app->request->post()) && $model->save() != null) {
            Yii::$app->session->setFlash('success', 'question Submitted');
            return $this->redirect(['view', 'id' => $model->id]);
        }
        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,]);
        }
    }
1304408
public function actionCreate()
    {
        $form = new LanguageForm();
        if ($form->load(Yii::$app->request->post()) && $form->validate()) {
            try {
                $model = $this->service->create($form);
                return $this->redirect(['view', 'id' => $model->id]);
            } catch (YiiException $e) {
                $form->addErrors($e->data);
            }
        }
        return $this->render('create', [
            'model' => $form,
        ]);
    }
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,
        ]);
    }
421025
protected static function create()
    {
        $config = new static();

        $config->config = (new ConfigFactory())->create($config->getProjectPath(), $config->CONFIG_FILE);

        return $config;
    }
245308
protected function createModel()
    {
        $model = new SearchPanelModel();

        $model->searchControls = $this->createSearchControls();

        $model->urlStateNames = $this->getUrlStateNames($model->searchControls);

        // Pass through of searchedEvent
        $this->searchedEvent = $model->searchedEvent;

        return $model;
    }
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'),
        ]);
    }
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));
	}
259008
public function actionCreate()
    {
        /* @var $model ActiveRecord */
        $model = $this->createModel();
        $this->beginTransaction();
        try {
            $this->fire('beforeCreate', [$model]);
            $model->load(Yii::$app->request->post(), '');
            $this->fire('create', [$model]);
            if ($model->save()) {
                $this->fire('created', [$model]);
                $this->commit();
                $model->refresh();
            } else {
                $this->fire('rollbackCreate', [$model]);
                $this->rollBack();
            }
        } catch (\Exception $e) {
            $this->fire('errorCreate', [$model, $e]);
            $this->rollBack();
            throw $e;
        }

        return $model;
    }
726637
public function newAction()
    {
        $model = $this->loadModel();
        if (!$model->isObjectNew()) {
            $this->_forward('noroute');
            return;
        }

        if ($this->getRequest()->isPost()) {
            $postData = $this->getRequest()->getPost();
            try {
                $model->isObjectNew(true);
                foreach ($this->preprocessPostData($postData) as $key => $value) {
                    $model->setDataUsingMethod($key, $value);
                }
                $model->save();
                $this->_redirectUrl($this->getHelper()->getGridUrl());
                $this->_getSession()->addSuccess('Saved Successfully');
                return;
            } catch (Exception $e) {
                $message = $e->getMessage();
                if ($e instanceof Zend_Db_Statement_Exception && $e->getChainedException() instanceof PDOException) {
                    /** @var PDOException $e */
                    $e = $e->getChainedException();
                    if (isset($e->errorInfo[0]) && $e->errorInfo[0] == 23000 && isset($e->errorInfo[1]) && $e->errorInfo[1] == 1062) {
                        $message = $this->getHelper()->__(
                            "Record already exists for %s '%s'",
                            $model->getIdFieldName(),
                            $model->getId()
                        );
                    }
                }
                Mage::logException($e);
                $this->_getSession()->addError($message);
            }
        }

        $this->loadLayout();
        $this->renderLayout();
    }
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]);
}
1219052
public function actionCreate()
    {
        $id = Yii::$app->request->post('question_id');
        if (($question = Question::findOne($id)) == null) {
            return $this->goBack();
        }
        $model = new Answer(['question_id' => $question->id]);
        if ($model->load(Yii::$app->request->post()) && $model->save() != null) {
            Yii::$app->session->setFlash('success', Yii::t('question', 'Operation completed.'));
            return $this->redirect(['/question/question/view', 'id' => $id]);
        }
        return $this->render('create', ['model' => $model, 'question' => $question]);
    }
1131281
public function actionCreate()
    {
        /** @var User $model */
        $model = Yii::createObject([
            'class' => User::className(),
            '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->getSession()->setFlash('success', Yii::t('user', 'User has been created'));
            return $this->redirect(['update', 'id' => $model->id]);
        }
        return $this->render('create', [
            'model' => $model,
        ]);
    }
546376
public function actionCreate()
	{
		$model=new Post;
		if(isset($_POST['Post']))
		{
			$model->attributes=$_POST['Post'];
			if($model->save())
				$this->redirect(array('view','id'=>$model->id));
		}

		$this->render('create',array(
			'model'=>$model,
		));
	}