protected function initialize4Twig(Application $app, Renderer $renderer)
    {
        // register autoloader.
        \Twig_Autoloader::register();

        // set directory.
        $twig_loader = null;
        foreach ($app->loader->find($app->config('directory.template')) as $dir) {
            if (! $twig_loader) {
                $twig_loader = new \Twig_Loader_Filesystem($dir->getRealPath());
            } else {
                $twig_loader->addPath($dir->getRealPath());
            }
        }
        if ($twig_loader) {
            foreach ($app->loader->find($app->config('directory.layout')) as $dir) {
                $twig_loader->addPath($dir->getRealPath(), 'layout');
            }
        }

        // init.
        $twig = $renderer->getEngine();
        $twig->setLoader($twig_loader);
        $twig->setCache($app->loader->find($app->config('directory.temp'))->first() . DS . 'twig');
        if ($app->config('renderer.auto_reload')) $twig->enableAutoReload();

        // default escape.
        if (! $app->config('renderer.auto_escape_html')) {
            $twig->removeExtension('escaper');
        }

        // configurations assign.
        $renderer->set('config', $app->configHierarchical());

        // helpers
        $renderer->setComponent('html', new HtmlHelper());
    }