Enable searching for projects
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @author Karsten Heiken, karsten@disposed.de
|
||||
*/
|
||||
class Projects extends CI_Controller {
|
||||
|
||||
/**
|
||||
@@ -67,4 +70,16 @@ class Projects extends CI_Controller {
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode(array('result' => $result)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for a specific project and return a list of possible results.
|
||||
*
|
||||
* @param type $needle The needle to look for in the haystack.
|
||||
*/
|
||||
public function search($needle) {
|
||||
$results = $this->project->search($needle);
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode(array('count' => count($results), 'results' => $results)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user