controllers/UserController.php
public function actionCreate()
	{
		$model = new User;

		if ($model->load($_POST) && $model->save()) {
			return $this->redirect(['view', 'id' => $model->id]);
		} else {
			return $this->render('create', [
				'model' => $model,
			]);
		}
	}
public function actionCreate()
	{
		$model = new User;

		if ($model->load($_POST) && $model->save()) {
			return $this->redirect(['view', 'id' => $model->id]);
		} else {
			return $this->render('create', [
				'model' => $model,
			]);
		}
	}
Creates a new User model.
If creation is successful, the browser will be redirected to the 'view' page.

@return mixed