/**
  * @param string $sDirName
  *
  * @return string
  */
 public static function CompileTemplates($sDirName, $oAction)
 {
     $sResult = '';
     if (\file_exists($sDirName)) {
         $aList = \RainLoop\Utils::FolderFiles($sDirName, '.html');
         foreach ($aList as $sName) {
             $sTemplateName = \substr($sName, 0, -5);
             $sResult .= '<script id="' . \preg_replace('/[^a-zA-Z0-9]/', '', $sTemplateName) . '" type="text/html" data-cfasync="false">' . $oAction->ProcessTemplate($sTemplateName, \file_get_contents($sDirName . '/' . $sName)) . '</script>';
         }
         $sResult = \trim($sResult);
     }
     return $sResult;
 }
Exemplo n.º 2
0
 /**
  * @param array $aList
  * @param string $sDirName
  * @param string $sNameSuffix = ''
  */
 public static function CompileTemplates(&$aList, $sDirName, $sNameSuffix = '')
 {
     if (\file_exists($sDirName)) {
         $aFileList = \RainLoop\Utils::FolderFiles($sDirName, '.html');
         foreach ($aFileList as $sName) {
             $sTemplateName = \substr($sName, 0, -5) . $sNameSuffix;
             $aList[$sTemplateName] = $sDirName . '/' . $sName;
         }
     }
 }