public function actionIndex()
    {
        
        if($this->searchClass === null){
            $searchModel = new AssigmentSearch;
        }  else {
            $class = $this->searchClass;
            $searchModel = new $class;
        }       

        $dataProvider = $searchModel->search(\Yii::$app->request->getQueryParams(), $this->userClassName, $this->usernameField);
        return $this->render('index', [
                'dataProvider' => $dataProvider,
                'searchModel' => $searchModel,
                'idField' => $this->idField,
                'usernameField' => $this->usernameField,
        ]);
    }