Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Autocomplete extends CI_Controller {
- function index()
- {
- $this->load->view('autocomplete');
- }
- function suggestions()
- {
- // Search term from jQuery
- $term = $this->input->post('term');
- // Do mysql query or what ever
- $arr = array($term, 'testa', 'testb', 'testc');
- // Return data
- echo json_encode($arr);
- }
- }
- /* End of file autocomplete.php */
- /* Location: ./application/controllers/autocomplete.php */
Add Comment
Please, Sign In to add comment