src/CarteBlanche/App/FrontController.php
public function render($params = null, $debug = null, $exception = null)
    {
        $_router 	= CarteBlanche::getContainer()->get('router');
        $_db 		= CarteBlanche::getContainer()->get('database');
        $request 	= CarteBlanche::getContainer()->get('request');
        $session 	= CarteBlanche::getContainer()->get('session');

        $_dbg = $request->getGet('debug');
        if (empty($debug) && isset($_GET['debug']))
            $debug = $_GET['debug'];

        if (empty($params['title'])) {
            if (!empty($_router->routes['action']))
                $params['title'] = $_router->routes['action'];
            else
                $params['title'] = 'Welcome';
        }
        $params['page_title'] = Helper::buildPageTitle($params['title']);
        if ($_db) {
            $params['db_queries'] = $_db->getCache();
        }
        $params['profiler'] = Helper::getProfiler();
        $params['altdb'] = $request->getUrlArg('altdb');
        $params['controller'] = get_class($this->getController());
        $params['action'] = $this->getActionName();

        $params['usersession'] = $session->getAttributes();
        $params['flashsession'] = $session->getBackup('flashes');
        if ($session->hasFlash())
            $params['flash_messages'] = $this->getFlashMessages();

        $params['charset'] = CarteBlanche::getConfig('html.charset', 'utf-8', true);

        $i18n_cfg = CarteBlanche::getConfig('i18n', array(), true);
        $languages_cfg = CarteBlanche::getConfig('languages', array(), true);
        $i18n = CarteBlanche::getContainer()->get('i18n');
        if ($i18n) {
            $default_lang = CarteBlanche::getContainer()->get('i18n')->getLocale();
            $lang_data = isset($languages_cfg[$default_lang]) ? $languages_cfg[$default_lang] : null;
            $params['lang'] = CarteBlanche::getContainer()->get('i18n')->getLanguageCode()
                .'-'.CarteBlanche::getContainer()->get('i18n')->getRegionCode();
            if (!empty($lang_data) && isset($lang_data['charset'])) {
                $params['charset'] = $lang_data['charset'];
            }
        }

        $params['request'] = \Library\Helper\Url::getRequestUrl();

        $_app_globals = CarteBlanche::getConfig('globals', null, true);
        $_cfg_globals = CarteBlanche::getConfig('globals');
        $_globals = array_merge($_app_globals, $_cfg_globals);
        if (!empty($_globals)) {
            $params['_globals'] = $_globals;
            if (!empty($_globals['meta_title']))
                Response::header('X-Website: '.$_globals['meta_title']);
        }

        $_app = CarteBlanche::getContainer()->get('config')
            ->getRegistry()->dumpStack('app');
        if (!empty($_app['app'])) {
            $params['_app'] = $_app['app'];
            if (!empty($_app['app']['name']))
                Response::header('Composed-by: '
                    .$_app['app']['name'].(!empty($_app['app']['version']) ? ' '.$_app['app']['version'] : '')
                );
        }

        $_manifest = CarteBlanche::getContainer()->get('config')
            ->getRegistry()->dumpStack('manifest');
        if (!empty($_manifest['manifest'])) {
            $params['manifest'] = $_app['manifest'];
        }

        $router_views = array();
        $_views = CarteBlanche::getContainer()->get('config')
            ->getRegistry()->dumpStack('views');
        if (!empty($_views)) {
            foreach ($_views as $_view) {
                $viewid = isset($_view['tpl']) ? $_view['tpl'] : uniqid();
                if (!isset($router_views[$viewid])) {
                    $router_views[$viewid] = $_view;
                    $router_views[$viewid]['iterations'] = 1;
                } else {
                    $router_views[$viewid]['iterations']++;
                }
            }
        }

//        \CarteBlanche\App\Debugger::shutdown(true, '\CarteBlanche\App\FrontController::renderExceptionStatic', $params);
        if (isset($exception)) $this->renderError($params, $exception);
        elseif (isset($debug)) $this->renderDebug($params, $debug);

        $ctrl_class = get_class($this->getController());
        if (property_exists($ctrl_class, 'template')) $tpl = $ctrl_class::$template;
        else trigger_error( "No template defined for controller '$ctrl_class'!", E_USER_ERROR );
        $router_views[] = array(
            'tpl'=>$tpl,
            'params'=>$params
        );
        $params['router_views'] = $router_views;
        return $this->view($tpl, $params, true, true);
    /*
        $router_views[] = array(
            'tpl'=>$tpl,
            'params'=>$params
        );
        $ctrl_class = get_class($this->controller);
        $params['router_views'] = $router_views;
        if (property_exists($ctrl_class, 'template')) return $this->view( $ctrl_class::$template, $params, true, true);
        else trigger_error( "No template defined for controller '$ctrl_class'!", E_USER_ERROR );
    */
    }
public function render($params = null, $debug = null, $exception = null)
    {
        $_router 	= CarteBlanche::getContainer()->get('router');
        $_db 		= CarteBlanche::getContainer()->get('database');
        $request 	= CarteBlanche::getContainer()->get('request');
        $session 	= CarteBlanche::getContainer()->get('session');

        $_dbg = $request->getGet('debug');
        if (empty($debug) && isset($_GET['debug']))
            $debug = $_GET['debug'];

        if (empty($params['title'])) {
            if (!empty($_router->routes['action']))
                $params['title'] = $_router->routes['action'];
            else
                $params['title'] = 'Welcome';
        }
        $params['page_title'] = Helper::buildPageTitle($params['title']);
        if ($_db) {
            $params['db_queries'] = $_db->getCache();
        }
        $params['profiler'] = Helper::getProfiler();
        $params['altdb'] = $request->getUrlArg('altdb');
        $params['controller'] = get_class($this->getController());
        $params['action'] = $this->getActionName();

        $params['usersession'] = $session->getAttributes();
        $params['flashsession'] = $session->getBackup('flashes');
        if ($session->hasFlash())
            $params['flash_messages'] = $this->getFlashMessages();

        $params['charset'] = CarteBlanche::getConfig('html.charset', 'utf-8', true);

        $i18n_cfg = CarteBlanche::getConfig('i18n', array(), true);
        $languages_cfg = CarteBlanche::getConfig('languages', array(), true);
        $i18n = CarteBlanche::getContainer()->get('i18n');
        if ($i18n) {
            $default_lang = CarteBlanche::getContainer()->get('i18n')->getLocale();
            $lang_data = isset($languages_cfg[$default_lang]) ? $languages_cfg[$default_lang] : null;
            $params['lang'] = CarteBlanche::getContainer()->get('i18n')->getLanguageCode()
                .'-'.CarteBlanche::getContainer()->get('i18n')->getRegionCode();
            if (!empty($lang_data) && isset($lang_data['charset'])) {
                $params['charset'] = $lang_data['charset'];
            }
        }

        $params['request'] = \Library\Helper\Url::getRequestUrl();

        $_app_globals = CarteBlanche::getConfig('globals', null, true);
        $_cfg_globals = CarteBlanche::getConfig('globals');
        $_globals = array_merge($_app_globals, $_cfg_globals);
        if (!empty($_globals)) {
            $params['_globals'] = $_globals;
            if (!empty($_globals['meta_title']))
                Response::header('X-Website: '.$_globals['meta_title']);
        }

        $_app = CarteBlanche::getContainer()->get('config')
            ->getRegistry()->dumpStack('app');
        if (!empty($_app['app'])) {
            $params['_app'] = $_app['app'];
            if (!empty($_app['app']['name']))
                Response::header('Composed-by: '
                    .$_app['app']['name'].(!empty($_app['app']['version']) ? ' '.$_app['app']['version'] : '')
                );
        }

        $_manifest = CarteBlanche::getContainer()->get('config')
            ->getRegistry()->dumpStack('manifest');
        if (!empty($_manifest['manifest'])) {
            $params['manifest'] = $_app['manifest'];
        }

        $router_views = array();
        $_views = CarteBlanche::getContainer()->get('config')
            ->getRegistry()->dumpStack('views');
        if (!empty($_views)) {
            foreach ($_views as $_view) {
                $viewid = isset($_view['tpl']) ? $_view['tpl'] : uniqid();
                if (!isset($router_views[$viewid])) {
                    $router_views[$viewid] = $_view;
                    $router_views[$viewid]['iterations'] = 1;
                } else {
                    $router_views[$viewid]['iterations']++;
                }
            }
        }

//        \CarteBlanche\App\Debugger::shutdown(true, '\CarteBlanche\App\FrontController::renderExceptionStatic', $params);
        if (isset($exception)) $this->renderError($params, $exception);
        elseif (isset($debug)) $this->renderDebug($params, $debug);

        $ctrl_class = get_class($this->getController());
        if (property_exists($ctrl_class, 'template')) $tpl = $ctrl_class::$template;
        else trigger_error( "No template defined for controller '$ctrl_class'!", E_USER_ERROR );
        $router_views[] = array(
            'tpl'=>$tpl,
            'params'=>$params
        );
        $params['router_views'] = $router_views;
        return $this->view($tpl, $params, true, true);
    /*
        $router_views[] = array(
            'tpl'=>$tpl,
            'params'=>$params
        );
        $ctrl_class = get_class($this->controller);
        $params['router_views'] = $router_views;
        if (property_exists($ctrl_class, 'template')) return $this->view( $ctrl_class::$template, $params, true, true);
        else trigger_error( "No template defined for controller '$ctrl_class'!", E_USER_ERROR );
    */
    }
Render the full application page view

@param   array       $params     An array of the parameters passed for the view parsing
@param   bool/str    $debug      Object to debug if so
@param   null/\Exception  $exception
@return  string
@see     self::view()