protected function renderHtmlTemplateContent()
    {
        $config = $this->config();

        $factory = $this->templateFactory();
        $factory->setDefaultClass($config['default_controller']);

        $controller = $factory->create($config['controller']);
        $controller->init($this->httpRequest());
        $controller['app_handler'] = $this;
        $controller->setData($this->getTemplateData());

        foreach ($config['partials'] as $varName => $templateIdent) {
            $this->view()->setDynamicTemplate($varName, $templateIdent);
        }

        return $this->view()->render($config['template'], $controller);
    }