Ejemplo n.º 1
0
 public function getExample5()
 {
     $query = \DB::getDoctrineConnection()->createQueryBuilder();
     $query->select(['id', 'name', 'email', 'country', 'posts_count'])->from('users')->where('posts_count > 40');
     $cfg = (new GridConfig())->setDataProvider(new DbalDataProvider($query))->setPageSize(5)->setColumns([new FieldConfig('id'), new FieldConfig('name'), new FieldConfig('email'), new FieldConfig('country'), new FieldConfig('posts_count')]);
     $grid = new Grid($cfg);
     $text = '<h1>Grid with DbalDataProvider</h1>';
     return view('demo.default', compact('grid', 'text'));
 }