Ejemplo n.º 1
0
function handle_request()
{
    $topics = Topic::find_all();
    $params = array('topics' => $topics);
    include $_SERVER['DOCUMENT_ROOT'] . "/templates/topic_list.php";
    return write_response($params);
}
Ejemplo n.º 2
0
function handle_request()
{
    # GET params
    $topic = $_GET['topic'];
    # PROCESS request
    $topic = Topic::find_by_name($topic);
    # HANDLE response
    $params = array('topic' => $topic);
    include $_SERVER['DOCUMENT_ROOT'] . "/templates/topic_view.php";
    return write_response($params);
}