actions.class.php 703 Bytes
Newer Older
Jonathan.Wage's avatar
Jonathan.Wage committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?php

/**
 * blog actions.
 *
 * @package    doctrine_website
 * @subpackage blog
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
 */
class blogActions extends sfActions
{
  /**
   * Executes index action
   *
   */
  public function executeIndex()
  {
19 20 21
    $blogPostTable = Doctrine_Manager::getInstance()->getTable('BlogPost');
    
    $this->latestBlogPosts = $blogPostTable->retrieveLatest(5);
Jonathan.Wage's avatar
Jonathan.Wage committed
22 23 24 25 26 27 28 29 30 31 32
  }
  
  public function executeView()
  {
    $slug = $this->getRequestParameter('slug');
    
    $blogPostTable = Doctrine_Manager::getInstance()->getTable('BlogPost');
    
    $this->blogPost = $blogPostTable->retrieveBySlug($slug);
  }
}