Filtering out posts by author

Hi, I’m new to yii and I would like to know how to filter posts shown on the front page by author when the author loggs in assuming the author logs in by email. So I would like to display posts like this:

Author Name:

  1. Post 1

  2. Post 2

If you using Yii standerd to fetch Post data, so you can filter data by author id( i assume author identify by author_id )

// $authorId is identification of author

$model = PostModel::model()->findAll("author_id=$authorId");

now you got all Post created by particular author.