示例#1
0
 /**
  * The index handler.
  * 
  * @access public
  * @return string The HTML code.
  */
 public function index()
 {
     $Article = new Article();
     $Client = new Client();
     $Button = new Button();
     $Proud = new Proud();
     $Banner = new Banner();
     $a = array();
     $a[] = 'PostedAt < ' . time();
     $a[] = 'Type = ' . Article::ARTICLE;
     $b = array();
     $b[] = 'PostedAt < ' . time();
     $b[] = 'Type = ' . Article::NEWS;
     foreach ($Banner->findList(array(), 'rand()', 0, 1) as $Banner) {
     }
     $this->getView()->set(array('Articles' => $Article->findShortList($a, 'PostedAt desc', 0, 4), 'News' => $Article->findShortList($b, 'PostedAt desc', 0, 2), 'Clients' => $Client->findList(array(), 'Position asc', 0, 8), 'Buttons' => $Button->findList(array(), 'Position asc', 0, 3), 'Prouds' => $Proud->getLastProuds(), 'Banner' => $Banner));
     return $this->getView()->render();
 }
示例#2
0
 /**
  * The index handler.
  * 
  * @access public
  * @return string The HTML code.
  */
 public function index()
 {
     $Banner = new Banner();
     $this->getView()->set('Banners', $Banner->findList(array(), 'Position asc'));
     return $this->getView()->render();
 }