Example #1
0
 /**
  * This method dispatches all actions.
  *
  * @param string $unconsumed_path  part of the dispatch path that was not consumed
  */
 public function perform($unconsumed_path)
 {
     $this->setupAutoload();
     // Add JS and StyleSheet to header
     PageLayout::addScript($this->getPluginURL() . '/javascript/forum.js');
     PageLayout::addStylesheet($this->getPluginURL() . '/stylesheets/forum.css');
     parent::perform($unconsumed_path);
 }
 function perform($unconsumed_path)
 {
     try {
         parent::perform($unconsumed_path);
     } catch (Exception $exception) {
         if ($exception instanceof Trails_Exception) {
             $status = $exception->getCode();
         } else {
             $status = 500;
         }
         header('HTTP/1.1 ' . $status . ' ' . $exception->getMessage());
         $this->render_json(array('status' => (int) $status, 'message' => $exception->getMessage()));
     }
 }