controllers/AssignmentController.php
/**
     * Lists all Assignment models.
     * @return mixed
     */
Lists all Assignment models.
@return mixed
Lists all Assignment models . @return mixed
public function actionIndex($userId = null)
    {
        if ($userId !== null) {
            $model = new Assignment(['user_id' => $userId, 'item_name' => Assignment::getAssignments($userId)]);
        } else {
            $model = new Assignment();
        }
        if ($model->load(Yii::$app->request->post()) && $model->validate()) {
            $model->assignments();
        }
        return $this->render('index', [
            'model' => $model,
        ]);
    }
public function actionIndex ( $ userId = null ) { if ( $ userId !== null ) { $ model = new Assignment ( [ 'user_id' => $ userId , 'item_name' => Assignment :: getAssignments ( $ userId ) ] ) ; } else { $ model = new Assignment ( ) ; } if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> validate ( ) ) { $ model -> assignments ( ) ; } return $ this -> render ( 'index' , [ 'model' => $ model , ] ) ; }
Lists all Assignment models.
Lists all Assignment models .