Searching and Sorting by Count of Related Items in CGridView

Comparing #6 with #7

Content

[...]
return new CActiveDataProvider(get_class($this), array(
'criteria' => $criteria,
'sort' => array(
'defaultOrder' => 't.username',
    'attributes' => array(     ...      // order by     'post_count' => array(      'asc' => 'post_count ASC',     'desc' => 'post_count DESC',      ),     '*',      ),     ),     'pagination' => array(     'pageSize' => 20,     ),      ));
}
```
'attributes' section of sort configurations lets us overload default searching. This configuration says, that when user wants to sort by 'post_count' field it should be done like specified. The last entry '*' says that every other field of this model should be treated normally.
### CGridView
Now we have prepared everything for our grid:
[...]