Пример #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();
 }
Пример #2
0
<? if( ($status = \App\Core\Cookie::once('status')) ) : ?>
	<div class="alert alert-<?php 
echo $status;
?>
">
		<button type="button" class="close" data-dismiss="alert" aria-label="Close">
			<span aria-hidden="true">&times;</span>
		</button>
		<?php 
echo \App\Core\Cookie::once('message');
?>
	</div>
<? endif; ?>