I have two models. 1) User and 2) Post
A user can have many posts. This means, here we will bind both models using hasMany. I am listing users and in that listing, I want to show the #no of posts. I am using cakephp paging. I am not able to list in this way. Any help pls.

User.php (Model)

```
<?php
class User extends AppModel {
    var $name = 'User';
    var $primaryKey = 'user_id';
    var $hasMany = array('Post');
}
?>

```

Post.php (Model)

```
<?php
class Post extends AppModel {
    var $name = 'Post';
    var $primaryKey = 'post_id';
}
?>

```

What should I write for pagination in controller?

I tried `counterCache` option, but didn't get any luck.