示例#1
0
 public function __construct($id, $site_info = NULL)
 {
     $this->blog_item = Model::load('BlogItem');
     $this->blog_item->id = $id;
     if (!$this->blog_item->load()) {
         throw new RequestException('No blog item found', RequestException::NOT_FOUND);
     }
     $this->page_title = $this->blog_item->heading;
     if (is_object($site_info)) {
         $this->page_title .= ' - ' . $site_info->title;
     }
     //$this->blog_item->body = preg_replace('/mid_/', 'tn_', $this->blog_item->body);
     $this->blog_user = Model::load('UserItem');
     $this->blog_user->id = $this->blog_item->user_id;
     $this->blog_user->load();
     //$this->blog_comments = $this->getCommentsFetch($this->blog_item->id);
     Model::disconnect(array($this->blog_item, $this->blog_user));
 }