public function renderDebug(&$params = null, $dbg = 'all', $parse_template = true)
    {
        $all_debug_infos = array( 'backtrace', 'php', 'server', 'session', 'constants', 'headers', 'system', 'router', 'registry', 'db' );
        if (!is_array($dbg)) {
            if ($dbg=='all' || $dbg==1) $dbg = $all_debug_infos;
            else $dbg = array( $dbg );
        }
        $debug = \CarteBlanche\App\Debugger::getInstance();
        foreach($dbg as $_dbg_info) {
            switch($_dbg_info) {
                case 'router':
                    $debug->addStack('object', CarteBlanche::getContainer()->get('router'), 'Router Object Dump');
                    break;
                case 'registry':
                    $debug->addStack('object', CarteBlanche::getContainer()->get('config')->getRegistry(), 'Registry Object Dump');
                    break;
                case 'db':
                    $debug->addStack('object', CarteBlanche::getContainer()->get('database'), 'Database Object Dump');
                    break;
                default:break;
            }
        }
        $params['debug'] = $debug;
        if ($parse_template) {
            $url_ref = str_replace('&', '&amp;', $_SERVER['HTTP_REFERER']);
            $params['return_url'] = $url_ref;
            $debug->setDebuggerTitle( 'CarteBlanche - Debugging request <a href="'.$url_ref.'" title="Back to this page"><em>'.str_replace(_ROOTHTTP, '/', $url_ref).'</em></a>' );
            $params['title'] = $debug->getDebuggerTitle();
            $tpl = 'profiler/template_profiler';
            return $this->view( $tpl, $params, true, true);
        }
        return;
    }