示例#1
0
 /**
  * Attempt to load the forum category using the id parameter.
  * @throws HTTP_Exception
  */
 public function before()
 {
     parent::before();
     $this->category = ORM::factory('Forum_Category', $this->request->param('id'));
     if (!$this->category->loaded()) {
         throw HTTP_Exception::factory('404', 'Forum category not found');
     }
 }
示例#2
0
 /**
  * Attempt to load the Topic using the 'ID' parameter in the url.
  *
  * @throws HTTP_Exception_404 if topic is not found
  */
 public function before()
 {
     parent::before();
     $this->topic = ORM::Factory('Forum_Topic', $this->request->param('id'));
     if (!$this->topic->loaded()) {
         throw HTTP_Exception::factory('404', 'Forum topic not found');
     }
 }
示例#3
0
 public function before()
 {
     parent::before();
     $this->post = ORM::factory('Forum_Post', $this->request->param('id'));
     if (!$this->post->loaded()) {
         throw HTTP_Exception::factory('404', 'Forum post not found');
     }
     $this->topic = $this->post->topic;
     $this->category = $this->topic->category;
 }