Implement simple search

This commit is contained in:
Eike Foken
2011-09-15 05:12:40 +02:00
parent 5e539daebd
commit aefc4e0387
7 changed files with 109 additions and 12 deletions

View File

@@ -0,0 +1,37 @@
<?php defined('BASEPATH') || exit('No direct script access allowed');
/**
* Search projects and experiments.
*
* @author Eike Foken <kontakt@eikefoken.de>
*/
class Search extends CI_Controller {
/**
* Calls the parent constructor.
*/
public function __construct() {
parent::__construct();
$this->load->model('experiment');
$this->load->helper('typography');
}
/**
*
*/
public function index() {
if ($this->input->get('query') != '') {
$query = explode(" ", $this->input->get('query'));
$data['projects'] = $this->project->search($this->input->get('query'));
$data['experiments'] = $this->experiment->search($this->input->get('query'));
$this->load->view('search/results', $data);
} else {
$this->load->view('search/new');
}
}
}
/* End of file search.php */
/* Location: ./application/controllers/search.php */