get('show_autosuggest', 1)) { // Get the suggestions. $model = $this->getModel('Suggestions', 'FinderModel'); $return = $model->getItems(); } // Check the data. if (empty($return)) { $return = array(); } // Use the correct json mime-type header('Content-Type: application/json'); // Send the response. echo json_encode($return); JFactory::getApplication()->close(); } }