0
我想顯示數組中的視圖形式,但我不知道如何? 任何一個可以幫助我: 我的控制器代碼:我想在視圖中顯示陣列yii2
$query = new Query;
$query
->select(['Day_Name'])
->from('days')
->join('INNER JOIN','doctorsworkday','doctorsworkday.Day_id =days.dayid');
$command = $query->createCommand();
$dataProvider = $command->queryAll();
$dataProvider= array($dataProvider);
return $this->render('view',
[
'model' => $this->findModel($id),
'days'=>$days,
'doctorsworkday'=>$doctorsworkday,
'dataProvider' => $dataProvider,
])
我的看法代碼:
<?=
DetailView::widget([
'model' => $dataProvider,
'attributes' => [
'Day_Name'
],
])
?>
但其結果表明:(未設置)
當我使用vat_dump($ dataProvider)有一個數組..但我不知道如何顯示它
它工作正常..非常感謝你..我感謝你的幫助:) –