O'Reilly logo

Yii Project Blueprints by Charles R. Portwood II

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Viewing a timeline of shares

The easiest way to display new content is to simply list it so that the newest items are shown first. On our timeline page, we want to provide the user with the ability to share something, view information about the user they are viewing (such as the number of shares, followers, and followees), and view things that the user has recently shared. To do this, we're going to take advantage of CListView loaded asynchronously from our main timeline view. This will allow us to reuse this view later on by simply making a GET request to an endpoint that we'll create later. In our TimelineController.php file located at protected/controllers/, implement the actionIndex() method:

public function actionIndex($id = NULL) { // If ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required