Exemplo n.º 1
0
 public function action_search()
 {
     $searchType = Input::post("search_type");
     $searchField = Input::post("search_field");
     if ($searchType == 'date') {
         $results = Model_Article::searchByDate($searchField);
     } else {
         $results = Model_Article::searchByText($searchField);
     }
     $view = View::forge("article/3_block", array('articles' => $results), false)->render();
     $data['html'] = $view;
     $data['status'] = "success";
     $data1['response'] = json_encode($data);
     $this->template = View::forge('response', $data1, false);
 }