public function render($blockName, $moduleName, $controllerName, $actionName, $dataHolder = null, $defaultDir = null)
{
$smartyData = $this->smarty->createData($this->smarty);
if ($dataHolder != null) {
foreach ($dataHolder as $key => $value) {
$smartyData->assign($key, $value);
}
}
\org\equinox\utils\debug\DebugBarFactory::add($smartyData->getTemplateVars(), 'Smarty', $blockName);
$this->smarty->setTemplateDir(ROOT . '/' . $this->templateDir);
$template = $moduleName . '/' . $controllerName . '/' . $actionName;
if (!$this->smarty->templateExists($template . '.tpl')) {
// check the default template
if ($defaultDir != null) {
$this->smarty->setTemplateDir($defaultDir);
$template = $controllerName . '/' . $actionName;
if (!$this->smarty->templateExists($template . '.tpl')) {
throw new \org\equinox\exception\EquinoxException("Cannot find ({$template}.tpl) template in (" . ROOT . '/' . $this->templateDir . ") nor in default directory ({$defaultDir})");
}
} else {
throw new \org\equinox\Exception\EquinoxException("Cannot find ({$template}.tpl) template in (" . $this->smarty->template_dir . ") and no default directory provided");
}
}
$html = $this->smarty->fetch($template . '.tpl', $smartyData);
\org\equinox\utils\debug\DebugBarFactory::add($html, 'Smarty', $blockName . '_html');
return $html;
}