Example #1
0
 /**
  * Retrieve html from storage
  *
  * @param string $themeName
  * @param string $layoutName
  * @param string $templateName
  * @return string
  */
 public function retrieveHtml($themeName, $layoutName, $templateName)
 {
     $templateModel = $this->createTemplateModel();
     $templateModel->getFilter()->theme_name('=', $themeName)->layout_name('=', $layoutName)->name('=', $templateName)->apply(1);
     /* This is an ugly solution to work with current theme */
     Context::setLayoutName($layoutName);
     Context::setTemplateName($templateName);
     Context::setThemeInfo($templateModel->getTheme());
     /* if (!$templateModel->exists()) {
            // throw exception ?
        } */
     return $templateModel->html;
 }