O'Reilly logo

PHP 5 Social Networking by Michael Peacock

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

Stream controller

What does our stream controller need to do? Let's walk through how we can take our model and turn it into a stream for the user to see.

  1. Require the stream model class, and instantiate the object.
  2. If the stream is empty, display an empty stream template.
  3. If the stream isn't empty, we display the main template and carry on.
  4. We take the status IDs and turn them into an array we can cache and send to the template. This gives us a list in the template of status IDs. In itself, this isn't useful, but it will be used to duplicate the template tag (where we will insert the status itself), the comments list, and the like / dislike list for each of the statuses, ready for the data to be pushed to the template later.
  5. We then need to iterate ...

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