Hey!
How are you all? First of all, sry about my english, I´m from Uruguay and you know, we speak Spanish here haha
I´m new with Yii2 and I know you all can help me, epic programmers
The key is that I got to read data from a database view and save it in a database table with other rows, then show it on a GridView, the problem is that the rows have different names and I really don´t know how to set each row.
Here I want to ask if the data that I´m calling is in the table, if it is not, i´ll
read the database view and insert it in the $dataProvider, but it doesn´t work
public function actionIndex()
{
$searchModel = new LaboratorioAlfaSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
if ($dataProvider-> totalCount == 0) {
$searchModel = new ViewLaboratorioAlfaSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
}
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
Thanks thanks thanks!