Wiki articles tagged with "count"

Showing 1-3 of 3 items.

Filter & Sort by Summary Data in GridView Yii 2.0

Created 9 years ago by Kartik V, updated 9 years ago by Kartik V.

This wiki explains how to add summary data from related models into your Yii Framework 2.0 gridview with filtering and sorting by the summary columns.

5 2
Viewed: 71 080 times
Version: 2.0
Category: Tutorials

Searching and Sorting by Count of Related Items in CGridView

Created 11 years ago by softark, updated 8 years ago by softark.

class Post extends CActiveRecord {


} ` When you list Authors in grid you would like to print the count of posts in column, allow sorting on this column and probably filtering by the count.

21 0
Viewed: 57 939 times
Version: 1.1
Category: How-tos

Relation scope to test existence of related records ("EXISTS")

Created 8 years ago by le_top, updated 8 years ago by le_top.

When one needs to select a record in a table that do not have related records through a relation, it is generally suggested to use a subquery. Personnaly, I prefer a high level approach, and I have a method to do it with scopes.

1 0
Viewed: 13 515 times
Version: 1.1
Category: How-tos