public function action_delete() { $friend = new Model_Friend($this->request->param('id')); if ($friend->creator_id != $this->me()->id) { Message::add('error', Kohana::message('friend', 'not-friends')); Request::current()->redirect('friend/list'); } if (arr::get($_POST, 'delete')) { $friend->delete(); Message::add('success', 'Friend deleted'); Request::current()->redirect('friend/list'); } $view = View::factory('friend/delete'); $view->friend = $friend; $this->template->content = $view; $this->template->title = 'Confirm'; }