Example #1
0
function web_router_render_page($module, $template, $data = [], $layout = 'main')
{
    web_response_set_http_code(200);
    web_response_set_content_type('text/html');
    web_response_set_body(web_render_page_content($module, $template, $data, $layout));
    web_response_flush();
}
Example #2
0
function web_response_redirect($uri, $host = null, $code = 302)
{
    $host = $host ? $host : $_SERVER['HTTP_HOST'];
    web_response_clear();
    web_response_add_header('Location: http://' . $host . '/' . ltrim($uri, '/'));
    web_response_set_http_code($code);
    web_response_flush();
}