The Blogs Page: The feed/digest view script
Friday, April 16, 2010

The view script for the feed/digest action is straightforward. If there is an error, that is rendered; otherwise, the feed digest is displayed.

if (isset($this->errorMessage))
{
  if (APPLICATION_ENV == 'development')
  {
    printf('<p class="error">%s</p>', $this->errorMessage);
  }
  else
  {
    echo '<p><strong>Recent Posts:</strong> None found</p>' . PHP_EOL;
  }
}
else
{
  $digest = $this->feedDigest($this->blog->feed);
 
  if (strlen($digest) > 0)
  {
    echo '<p><strong>Recent Posts:</strong></p>' . PHP_EOL;
    echo  $digest . PHP_EOL;
  }
  else
  {
    echo '<p><strong>Recent Posts:</strong> None found</p>' . PHP_EOL;
  }
}

The view helper used to generate the digest will be examined in the next post.

Posted by James at 12:02 am   0 comments

Leave a Reply