Yii undefined dataprovider


I have created with CRUD my controller, search file etc. and now I want to display these but I am getting the error message: Undefined variable: dataProvider

I know, that I have to something like:

return $this->render('view_name', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,

but can anyone tell me:

  • where I have to add this (in my file where the gridview for example is) or in my controller file? And where exactyl in the file have I to add these lines?
  • whats the view name? the name of my file? or what?

Thanks in advance!

Sorry, can be closed. I had a wrong controller.

1 Like