function handle_request() { $topics = Topic::find_all(); $params = array('topics' => $topics); include $_SERVER['DOCUMENT_ROOT'] . "/templates/topic_list.php"; return write_response($params); }
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); }