controllers/DefaultController.php
public function actionTasknotecreate($projectid, $taskid)
    {
        $model = new TaskNote();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(Url::toRoute(['tasknoteview', 'projectid' => $projectid, 'taskid' => $taskid, 'id' => $model->id,]));
        } else {
            $model->taskID = $taskid;
            return $this->render('tasknotecreate', [
                'model' => $model,]);
        }
    }
public function actionTasknotecreate($projectid, $taskid)
    {
        $model = new TaskNote();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(Url::toRoute(['tasknoteview', 'projectid' => $projectid, 'taskid' => $taskid, 'id' => $model->id,]));
        } else {
            $model->taskID = $taskid;
            return $this->render('tasknotecreate', [
                'model' => $model,]);
        }
    }
public function actionTasknotecreate ( $ projectid , $ taskid ) { $ model = new TaskNote ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { return $ this -> redirect ( Url :: toRoute ( [ 'tasknoteview' , 'projectid' => $ projectid , 'taskid' => $ taskid , 'id' => $ model -> id , ] ) ) ; } else { $ model -> taskID = $ taskid ; return $ this -> render ( 'tasknotecreate' , [ 'model' => $ model , ] ) ; } }
Creates a new TaskNote model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new TaskNote model . If creation is successful the browser will be redirected to the view page .