I have two tables
Quote - has ID column
Quote detail has - Quote_id column
I have models for them both that work perfectly.
I have a view that should combine the two tables
at the moment I have done this in my controller. (profileController)
public function actionView($id)
{
$searchModel = new QuoteSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$searchDetailModel = new QuoteDetailSearch();
$dataDetailProvider = $searchDetailModel->search(Yii::$app->request->queryParams);
return $this->render('view', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'searchDetailModel' => $searchDetailModel,
'dataDetailProvider' => $dataDetailProvider,
'model' => $this->findModel($id),
'modelDetail' => $this->findModel($id),
// return $this->render('view', [
// 'model' => $this->findModel($id),
]);
}
what I need to do is filter the quotedetail table by the quote ID and then loop through the fields adding them to the view.
What do I need to do…