/** * @return string * @throws \yii\web\ServerErrorHttpException */ public function actionIndex() { $searchModelConfig = ['model' => Customer::className(), 'partialMatchAttributes' => ['first_name', 'middle_name', 'last_name'], 'additionalConditions' => []]; /** @var SearchModel $searchModel */ $searchModel = new SearchModel($searchModelConfig); $dataProvider = $searchModel->search(\Yii::$app->request->queryParams); return $this->render('index', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel]); }
/** * @return Customer|null */ public function getCustomer() { return $this->hasOne(Customer::className(), ['id' => 'customer_id']); }