public function initTemplate($forceReplace = false)
 {
     if ($this->_templateInitialized && !$forceReplace) {
         return;
     }
     $tpl = Template::getTemplate();
     //no template
     if (!$tpl) {
         $this->log->debug('try initialize template, but no template configured', 'router');
         return false;
     }
     $this->_template = $tpl;
     // Set langs/urls vars into tpl
     $this->_template->setVar('urls', Router::getUrls($this->language->getLanguage(), Http::isHttps()), false, true);
     $this->_template->setVar('langs', $this->language->getVars(true), false, true);
     $this->_template->setVar('lang', $this->language->getLanguage(), false, true);
     //init assets
     if (!Http::isAjax()) {
         $this->_template->initAssets();
     }
     $this->_templateInitialized = true;
     $this->log->debug('Initialize template', 'router');
 }
Example #2
0
 public function getUrls($lang = null, $ssl = false)
 {
     return Router::getUrls($lang, $ssl);
 }