public function index($msg = NULL) { $results = NULL; $results2 = NULL; $query = NULL; $view = new View('search_example'); $view->bind("results", $results)->bind("results2", $results2)->bind("query", $query)->bind("msg", $msg); if (!empty($_GET["q"])) { try { $query = $_GET["q"]; $form = $_GET["form"]; if ($form == "artists") { $results = Search::instance()->find($query); } else { Search::instance()->load_search_libs(); $query = Zend_Search_Lucene_Search_QueryParser::parse($query); $hits = Search::instance()->find($query); if (sizeof($hits) > 0) { $results2 = $query->highlightMatches(iconv('UTF-8', 'ASCII//TRANSLIT', $hits[0]->body)); } else { $results2 = '<p style="color:#f00">No results found</p>'; } } } catch (Exception $e) { Kohana::log("error", $e); } } $view->render(TRUE); }
/** Sends emails to using various templates */ protected function send_email($subject, $template = 'registration') { $view = new View("email/" . $template); $view->bind('context_user', $this); $mailer = new AmazonSESMailer('AKIAJK43Z3GIIF3XRIJQ', 'z1ZdTXoiNY1/I/JJmyVXfR9mU93kuq5Oo4vjW4cw'); $mailer->AddAddress($this->email); $mailer->Subject = $subject; $mailer->SetFrom('*****@*****.**'); $mailer->MsgHtml($view->render()); $mailer->Send(); }