Example #1
0
 public function showRemove()
 {
     if (!($feed = $this->getFeed())) {
         return View::handleError('Unable to located feed.');
     }
     $title = 'Remove Feed';
     $feeds = $this->getFeeds();
     if (Input::method() === 'POST') {
         $query = $this->app->db->query('DELETE FROM feeds WHERE id = :id');
         $query->bind(':id', $feed->id);
         if ($query->execute()) {
             Cookie::set('status', 'danger');
             Cookie::set('message', 'Feed removed!');
             return View::redirect('/');
         }
     }
     return View::make('feed.remove')->with(compact('title', 'feeds', 'feed'))->render();
 }
Example #2
0
 /**
  * Register the exception handler.
  * 
  * @return void
  */
 public function registerExceptionHandler()
 {
     set_exception_handler(function ($e) {
         return View::handleError($e->getMessage(), 500);
     });
 }