Answer the question
In order to leave comments, you need to log in
How to display current user info table with DAO in Yii2?
There is a controller
public function actionIndex()
{
$dataProvider = new ActiveDataProvider([
'query' => Transactions::find(),
]);
return $this->render('index', [
'dataProvider' => $dataProvider,
]);
}
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'number',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
Answer the question
In order to leave comments, you need to log in
You make a request through DAO, and create an ArrayDataProvider instead of an ActiveDataProvider.
$provider = new ArrayDataProvider([
'allModels' => $users,
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question