typeahead.php 501 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
 * Created by PhpStorm.
 * User: ep
 * Date: 12/23/15
 * Time: 6:17 PM
 */


namespace qfq;

use qfq;

require_once(__DIR__ . '/../qfq/form/TypeAhead.php');
require_once(__DIR__ . '/../qfq/Constants.php');


/**
 * Return JSON encoded answer
 *
 */


try {
    $qfq = new \qfq\TypeAhead();

    $answer = $qfq->process();

} catch (\Exception $e) {
    $answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}

header("Content-Type: application/json");
echo json_encode($answer);