wordygo/application/controllers/ajax/dictionary.php
2013-11-26 12:54:17 +01:00

28 lines
810 B
PHP

<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Dictionary extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('dictionary_model');
}
public function en_search_all() {
$word = trim($_POST['word']);
$data['result'] = $this->dictionary_model->en_search_all($word);
if(count($data['result']) > 0) {
$this->load->view('dictionary/result', $data);
} else {
echo 'No results were found!!!';
}
}
public function search() {
$language_abbr = $_POST['language'];
$word = trim($_POST['word']);
$data['result'] = $this->dictionary_model->search($language_abbr, $word);
if(count($data['result']) > 0) {
$this->load->view('dictionary/result', $data);
} else {
echo 'No results were found!!!';
}
}
}
?>