From e9363b4e414845ab222a0fd692e567f91f57d35b Mon Sep 17 00:00:00 2001 From: Carsten Brandt <mail@cebe.cc> Date: Fri, 11 Apr 2014 10:10:20 +0200 Subject: [PATCH] Looks like GridView has its own section... :) added a hint and link --- docs/guide/data-widgets.md | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/docs/guide/data-widgets.md b/docs/guide/data-widgets.md index f986943..6ebeba8 100644 --- a/docs/guide/data-widgets.md +++ b/docs/guide/data-widgets.md @@ -5,43 +5,8 @@ GridView -------- The [[yii\grid\GridView]] widget is a powerful tool to create a data grid that provides pagination, sorting -and filtering of the data out of the box. -The GridView gets its data from a [data provider](data-providers.md) which is responsible for sorting and -pagination. -The following code shows a basic example of a gridview showing Users from the database(`User` is an [active record](active-record.md)): +and filtering of the data out of the box. See the [data grid section](data-grid.md) for more details. -In the controller action: - -```php -$dataProvider = new ActiveDataProvider(['query' => User::find()]); - -return $this->render('myview', ['dataProvider' => $dataProvider]); -``` - -In the view `myview.php`: - -```php -echo GridView::widget([ - 'dataProvider' => $dataProvider, - 'columns' => [ - 'id', - 'name', - 'email', - 'last_login_date:datetime', - [ - 'class' => 'yii\grid\ActionColumn', - ] - ], -]); ?> -``` - -### Filtering - -TDB - -### Filtering by related columns - -TDB ListView -------- -- libgit2 0.27.1